From 5c2187ca4403e8d73bf80918cc31492aa22150e2 Mon Sep 17 00:00:00 2001 From: fincs Date: Wed, 26 Sep 2018 20:12:25 +0200 Subject: [PATCH] OpenGL examples: use eglMakeCurrent to unbind the context/surfaces in deinitEgl --- graphics/opengl/dynamic_resolution/source/main.cpp | 1 + graphics/opengl/es2gears/source/main.c | 1 + graphics/opengl/lenny/source/main.cpp | 1 + graphics/opengl/simple_triangle/source/main.cpp | 1 + graphics/opengl/textured_cube/source/main.cpp | 1 + 5 files changed, 5 insertions(+) diff --git a/graphics/opengl/dynamic_resolution/source/main.cpp b/graphics/opengl/dynamic_resolution/source/main.cpp index 1944147..eff8c62 100644 --- a/graphics/opengl/dynamic_resolution/source/main.cpp +++ b/graphics/opengl/dynamic_resolution/source/main.cpp @@ -155,6 +155,7 @@ static void deinitEgl() { if (s_display) { + eglMakeCurrent(s_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (s_context) { eglDestroyContext(s_display, s_context); diff --git a/graphics/opengl/es2gears/source/main.c b/graphics/opengl/es2gears/source/main.c index cd94b1d..b93079f 100644 --- a/graphics/opengl/es2gears/source/main.c +++ b/graphics/opengl/es2gears/source/main.c @@ -174,6 +174,7 @@ static void deinitEgl() { if (s_display) { + eglMakeCurrent(s_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (s_context) { eglDestroyContext(s_display, s_context); diff --git a/graphics/opengl/lenny/source/main.cpp b/graphics/opengl/lenny/source/main.cpp index 5a7a032..2c460c3 100644 --- a/graphics/opengl/lenny/source/main.cpp +++ b/graphics/opengl/lenny/source/main.cpp @@ -152,6 +152,7 @@ static void deinitEgl() { if (s_display) { + eglMakeCurrent(s_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (s_context) { eglDestroyContext(s_display, s_context); diff --git a/graphics/opengl/simple_triangle/source/main.cpp b/graphics/opengl/simple_triangle/source/main.cpp index 0d08418..a0b9bd5 100644 --- a/graphics/opengl/simple_triangle/source/main.cpp +++ b/graphics/opengl/simple_triangle/source/main.cpp @@ -139,6 +139,7 @@ static void deinitEgl() { if (s_display) { + eglMakeCurrent(s_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (s_context) { eglDestroyContext(s_display, s_context); diff --git a/graphics/opengl/textured_cube/source/main.cpp b/graphics/opengl/textured_cube/source/main.cpp index 53c402a..e9a7c9d 100644 --- a/graphics/opengl/textured_cube/source/main.cpp +++ b/graphics/opengl/textured_cube/source/main.cpp @@ -152,6 +152,7 @@ static void deinitEgl() { if (s_display) { + eglMakeCurrent(s_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); if (s_context) { eglDestroyContext(s_display, s_context);