From 88ab67dad2787c26d90b53f00963ed6586145c1d Mon Sep 17 00:00:00 2001 From: Joey de Vries Date: Wed, 29 Apr 2020 10:41:28 +0200 Subject: [PATCH] Add glDeleteProgram call to relevant examples. --- src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp | 1 + .../2.3.hello_triangle_exercise1/hello_triangle_exercise1.cpp | 1 + .../2.5.hello_triangle_exercise3/hello_triangle_exercise3.cpp | 2 ++ src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp | 1 + .../3.2.shaders_interpolation/shaders_interpolation.cpp | 1 + src/7.in_practice/3.2d_game/0.full_source/program.cpp | 2 +- .../3.2d_game/0.full_source/progress/2.program.cpp | 2 +- 7 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp b/src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp index adbe53b..926bfd6 100644 --- a/src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp +++ b/src/1.getting_started/2.1.hello_triangle/hello_triangle.cpp @@ -157,6 +157,7 @@ int main() // ------------------------------------------------------------------------ glDeleteVertexArrays(1, &VAO); glDeleteBuffers(1, &VBO); + glDeleteProgram(shaderProgram); // glfw: terminate, clearing all previously allocated GLFW resources. // ------------------------------------------------------------------ diff --git a/src/1.getting_started/2.3.hello_triangle_exercise1/hello_triangle_exercise1.cpp b/src/1.getting_started/2.3.hello_triangle_exercise1/hello_triangle_exercise1.cpp index c7989bd..3045b4c 100644 --- a/src/1.getting_started/2.3.hello_triangle_exercise1/hello_triangle_exercise1.cpp +++ b/src/1.getting_started/2.3.hello_triangle_exercise1/hello_triangle_exercise1.cpp @@ -163,6 +163,7 @@ int main() // ------------------------------------------------------------------------ glDeleteVertexArrays(1, &VAO); glDeleteBuffers(1, &VBO); + glDeleteProgram(shaderProgram); // glfw: terminate, clearing all previously allocated GLFW resources. // ------------------------------------------------------------------ diff --git a/src/1.getting_started/2.5.hello_triangle_exercise3/hello_triangle_exercise3.cpp b/src/1.getting_started/2.5.hello_triangle_exercise3/hello_triangle_exercise3.cpp index 25c016a..ed227c5 100644 --- a/src/1.getting_started/2.5.hello_triangle_exercise3/hello_triangle_exercise3.cpp +++ b/src/1.getting_started/2.5.hello_triangle_exercise3/hello_triangle_exercise3.cpp @@ -158,6 +158,8 @@ int main() // ------------------------------------------------------------------------ glDeleteVertexArrays(2, VAOs); glDeleteBuffers(2, VBOs); + glDeleteProgram(shaderProgramOrange); + glDeleteProgram(shaderProgramYellow); // glfw: terminate, clearing all previously allocated GLFW resources. // ------------------------------------------------------------------ diff --git a/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp b/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp index 35b2e71..0644eb2 100644 --- a/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp +++ b/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp @@ -164,6 +164,7 @@ int main() // ------------------------------------------------------------------------ glDeleteVertexArrays(1, &VAO); glDeleteBuffers(1, &VBO); + glDeleteProgram(shaderProgram); // glfw: terminate, clearing all previously allocated GLFW resources. // ------------------------------------------------------------------ diff --git a/src/1.getting_started/3.2.shaders_interpolation/shaders_interpolation.cpp b/src/1.getting_started/3.2.shaders_interpolation/shaders_interpolation.cpp index 68cb1c2..9f7928b 100644 --- a/src/1.getting_started/3.2.shaders_interpolation/shaders_interpolation.cpp +++ b/src/1.getting_started/3.2.shaders_interpolation/shaders_interpolation.cpp @@ -161,6 +161,7 @@ int main() // ------------------------------------------------------------------------ glDeleteVertexArrays(1, &VAO); glDeleteBuffers(1, &VBO); + glDeleteProgram(shaderProgram); // glfw: terminate, clearing all previously allocated GLFW resources. // ------------------------------------------------------------------ diff --git a/src/7.in_practice/3.2d_game/0.full_source/program.cpp b/src/7.in_practice/3.2d_game/0.full_source/program.cpp index a31eee1..a63d891 100644 --- a/src/7.in_practice/3.2d_game/0.full_source/program.cpp +++ b/src/7.in_practice/3.2d_game/0.full_source/program.cpp @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode) { - // When a user presses the escape key, we set the WindowShouldClose property to true, closing the application + // when a user presses the escape key, we set the WindowShouldClose property to true, closing the application if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) glfwSetWindowShouldClose(window, true); if (key >= 0 && key < 1024) diff --git a/src/7.in_practice/3.2d_game/0.full_source/progress/2.program.cpp b/src/7.in_practice/3.2d_game/0.full_source/progress/2.program.cpp index ff66ef0..cf3fefb 100644 --- a/src/7.in_practice/3.2d_game/0.full_source/progress/2.program.cpp +++ b/src/7.in_practice/3.2d_game/0.full_source/progress/2.program.cpp @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode) { - // When a user presses the escape key, we set the WindowShouldClose property to true, closing the application + // when a user presses the escape key, we set the WindowShouldClose property to true, closing the application if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) glfwSetWindowShouldClose(window, true); if (key >= 0 && key < 1024)