display_win32->egl_disp = egl_disp;
display_win32->egl_version = epoxy_egl_version (egl_disp);
- eglBindAPI(EGL_OPENGL_ES_API);
+ eglBindAPI (EGL_OPENGL_ES_API);
display_win32->hasEglSurfacelessContext =
epoxy_has_egl_extension (egl_disp, "EGL_KHR_surfaceless_context");
if (best_idx == 0 ||
!wglMakeCurrent (hdc, display_win32->dummy_context_wgl.hglrc))
{
+ if (display_win32->dummy_context_wgl.hglrc != NULL)
+ wglDeleteContext (display_win32->dummy_context_wgl.hglrc);
+
g_set_error_literal (error, GDK_GL_ERROR,
GDK_GL_ERROR_NOT_AVAILABLE,
_("No GL implementation is available"));
display_win32->wgl_pixel_format = best_idx;
display_win32->gl_version = epoxy_gl_version ();
+ /* We must have OpenGL/WGL 2.0 or later, or have the GL_ARB_shader_objects extension */
+ if (display_win32->gl_version < 20)
+ {
+ if (!epoxy_has_gl_extension ("GL_ARB_shader_objects"))
+ {
+ wglMakeCurrent (NULL, NULL);
+ wglDeleteContext (display_win32->dummy_context_wgl.hglrc);
+
+ g_set_error_literal (error, GDK_GL_ERROR,
+ GDK_GL_ERROR_NOT_AVAILABLE,
+ _("No GL implementation is available"));
+
+ return FALSE;
+ }
+ }
+
display_win32->hasWglARBCreateContext =
epoxy_has_wgl_extension (hdc, "WGL_ARB_create_context");
display_win32->hasWglEXTSwapControl =