diff options
author | Chad Versace <chad.versace@linux.intel.com> | 2013-11-24 14:59:56 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@linux.intel.com> | 2013-11-24 15:31:12 -0800 |
commit | 9fa8dc7b0e925bc987435ee2988d208de4eeb96b (patch) | |
tree | abb17868a60748c53c7302966b2001bd2a42e904 /src | |
parent | 142dba8db661dfa2b5b65c9fd2faa8821ec529ef (diff) |
cgl: Fix validation of system version
I failed at hex :(
For OS X 10.7, check that platform->system_version_full >= 0x0a07, not
0x1070. Ditto for 10.9.
Fixes creation of OpenGL 3.2 contexts. Tested on OS X 10.9 Mavericks.
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/waffle/cgl/cgl_config.m | 8 | ||||
-rw-r--r-- | src/waffle/cgl/cgl_platform.h | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/waffle/cgl/cgl_config.m b/src/waffle/cgl/cgl_config.m index b6dc8d7..52dc225 100644 --- a/src/waffle/cgl/cgl_config.m +++ b/src/waffle/cgl/cgl_config.m @@ -89,7 +89,7 @@ cgl_config_check_attrs(const struct cgl_platform *plat, } if (attrs->context_full_version > 32) { - if (plat->system_version_full >= 0x1090) { + if (plat->system_version_full >= 0x0a09) { wcore_errorf(WAFFLE_ERROR_UNSUPPORTED_ON_PLATFORM, "Waffle CGL was built only with Mac OS 10.8 " "capabilities, and so cannot create an " @@ -106,7 +106,7 @@ cgl_config_check_attrs(const struct cgl_platform *plat, else if (attrs->context_full_version == 32) { assert(attrs->context_profile == WAFFLE_CONTEXT_CORE_PROFILE); - if (plat->system_version_full < 0x1070) + if (plat->system_version_full < 0x0a07) goto error_need_os_10_7; return true; @@ -117,7 +117,7 @@ cgl_config_check_attrs(const struct cgl_platform *plat, // OpenGL 3.2 Core Profile. assert(attrs->context_profile == WAFFLE_NONE); - if (plat->system_version_full < 0x1070) + if (plat->system_version_full < 0x0a07) goto error_need_os_10_7; return true; @@ -178,7 +178,7 @@ cgl_config_fill_pixel_format_attrs( // Emulate EGL_KHR_create_context, which allows the implementation to // return a context of the latest supported flavor that is // backwards-compatibile with the requested flavor. - if (plat->system_version_full >= 0x1070) { + if (plat->system_version_full >= 0x0a07) { if (attrs->context_full_version == 32) { ADD_ATTR(kCGLPFAOpenGLProfile, (int) kCGLOGLPVersion_3_2_Core); } diff --git a/src/waffle/cgl/cgl_platform.h b/src/waffle/cgl/cgl_platform.h index 52e3e84..71bf5b8 100644 --- a/src/waffle/cgl/cgl_platform.h +++ b/src/waffle/cgl/cgl_platform.h @@ -37,6 +37,8 @@ struct cgl_platform { int32_t system_version_minor; /// @brief Has value (major << 8) | minor. + /// + /// For example, 0x0a09 indicates OS X 10.9 Mavericks. int32_t system_version_full; /// @brief The OpenGL library obtained with dlopen(). |