[cairo] cairo wgl trouble

Henry (Yu) Song henry.song at samsung.com
Wed Mar 4 19:26:05 PST 2015


Does anybody try to build cairo with wgl support on windows (windows 8 in my case)?

I have fixed two issues

(1) cairo_wgl_device_create (HGLRC rc) API is not correct.  In order to create a compatible dummy DC, one must use the same pixel format used to create rc.  A more correct API should be cairo_wgl_device_create (HGLRC rc, int pixel_format)

(2) OpenGL 3.0+ uses glGetStringi (GL_EXTENSIONS, index) to query for extensions.  So this must be changed in cairo-gl-info.c - glGetString (GL_EXTENSIONS) returns invalid enum.

I did change these two issues, but more issues ahead.

in cairo-gl-info.c/_cairo_get_gl_flavor (), querying for const char *version = (const char *) glGetString (GL_VERSION) is successful.  But after calling strstr (version, "OpenGL ES 2"), this version "auto-magically" changed to point to "OpenGL ES 2" string, and gl_flavor becomes CAIRO_GL_FLAVOR_ES - this is inspected within visual studio 2012.  Why? 

Thanks in advance

Henry


More information about the cairo mailing list