mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-10 02:23:23 +08:00
Add glDeleteProgram call to relevant examples.
This commit is contained in:
@@ -157,6 +157,7 @@ int main()
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
glDeleteVertexArrays(1, &VAO);
|
glDeleteVertexArrays(1, &VAO);
|
||||||
glDeleteBuffers(1, &VBO);
|
glDeleteBuffers(1, &VBO);
|
||||||
|
glDeleteProgram(shaderProgram);
|
||||||
|
|
||||||
// glfw: terminate, clearing all previously allocated GLFW resources.
|
// glfw: terminate, clearing all previously allocated GLFW resources.
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ int main()
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
glDeleteVertexArrays(1, &VAO);
|
glDeleteVertexArrays(1, &VAO);
|
||||||
glDeleteBuffers(1, &VBO);
|
glDeleteBuffers(1, &VBO);
|
||||||
|
glDeleteProgram(shaderProgram);
|
||||||
|
|
||||||
// glfw: terminate, clearing all previously allocated GLFW resources.
|
// glfw: terminate, clearing all previously allocated GLFW resources.
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|||||||
@@ -158,6 +158,8 @@ int main()
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
glDeleteVertexArrays(2, VAOs);
|
glDeleteVertexArrays(2, VAOs);
|
||||||
glDeleteBuffers(2, VBOs);
|
glDeleteBuffers(2, VBOs);
|
||||||
|
glDeleteProgram(shaderProgramOrange);
|
||||||
|
glDeleteProgram(shaderProgramYellow);
|
||||||
|
|
||||||
// glfw: terminate, clearing all previously allocated GLFW resources.
|
// glfw: terminate, clearing all previously allocated GLFW resources.
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ int main()
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
glDeleteVertexArrays(1, &VAO);
|
glDeleteVertexArrays(1, &VAO);
|
||||||
glDeleteBuffers(1, &VBO);
|
glDeleteBuffers(1, &VBO);
|
||||||
|
glDeleteProgram(shaderProgram);
|
||||||
|
|
||||||
// glfw: terminate, clearing all previously allocated GLFW resources.
|
// glfw: terminate, clearing all previously allocated GLFW resources.
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|||||||
@@ -161,6 +161,7 @@ int main()
|
|||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
glDeleteVertexArrays(1, &VAO);
|
glDeleteVertexArrays(1, &VAO);
|
||||||
glDeleteBuffers(1, &VBO);
|
glDeleteBuffers(1, &VBO);
|
||||||
|
glDeleteProgram(shaderProgram);
|
||||||
|
|
||||||
// glfw: terminate, clearing all previously allocated GLFW resources.
|
// glfw: terminate, clearing all previously allocated GLFW resources.
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode)
|
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)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
glfwSetWindowShouldClose(window, true);
|
glfwSetWindowShouldClose(window, true);
|
||||||
if (key >= 0 && key < 1024)
|
if (key >= 0 && key < 1024)
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mode)
|
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)
|
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||||
glfwSetWindowShouldClose(window, true);
|
glfwSetWindowShouldClose(window, true);
|
||||||
if (key >= 0 && key < 1024)
|
if (key >= 0 && key < 1024)
|
||||||
|
|||||||
Reference in New Issue
Block a user