Fix a bug in error checking conditions. This avoids unintentional Legacy of the created OpenGL context

This commit is contained in:
sumibi-yakitori 2023-06-01 16:46:24 +09:00
parent 3c9b3ead6f
commit 7b8a5235d4

View File

@ -344,14 +344,14 @@ create_pixel_format (GdkGLVersion *version,
if (gdk_gl_version_get_major (version) >= 4)
{
attrs[1] = (CGLPixelFormatAttribute)kCGLOGLPVersion_GL4_Core;
if (CGLChoosePixelFormat (attrs, &format, &n_format))
if (CHECK (error, CGLChoosePixelFormat (attrs, &format, &n_format)))
return g_steal_pointer (&format);
}
if (gdk_gl_version_greater_equal (version, &GDK_GL_MIN_GL_VERSION))
{
attrs[1] = (CGLPixelFormatAttribute)kCGLOGLPVersion_GL3_Core;
if (CGLChoosePixelFormat (attrs, &format, &n_format))
if (CHECK (error, CGLChoosePixelFormat (attrs, &format, &n_format)))
return g_steal_pointer (&format);
}