summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2015-10-31 19:58:06 +1100
committer Vas Crabb <vas@vastheman.com>2015-10-31 19:58:06 +1100
commite66d5e013225b9ea44aae13ba8978d6cee5abb0d (patch)
treece9a5a2c716eec58711a9a4fda2f7fb031ca9009 /3rdparty/bgfx
parent79ae956643c37b85cbec0caed8899fe76920c8da (diff)
bgfx support for 10.6
upstream pull request: https://github.com/bkaradzic/bgfx/pull/560
Diffstat (limited to '3rdparty/bgfx')
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.mm14
1 files changed, 9 insertions, 5 deletions
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm
index 68f6d92f8ca..e8ff5164d80 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.mm
+++ b/3rdparty/bgfx/src/glcontext_nsgl.mm
@@ -134,9 +134,12 @@ namespace bgfx { namespace gl
{
BX_UNUSED(_width, _height);
+#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
bool hidpi = !!(_flags&BGFX_RESET_HIDPI);
NSOpenGLView* glView = (NSOpenGLView*)m_view;
- [glView setWantsBestResolutionOpenGLSurface:hidpi];
+ if ([glView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
+ [glView setWantsBestResolutionOpenGLSurface:hidpi];
+#endif // defined(MAC_OS_X_VERSION_MAX_ALLOWED) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
bool vsync = !!(_flags&BGFX_RESET_VSYNC);
GLint interval = vsync ? 1 : 0;
@@ -147,11 +150,12 @@ namespace bgfx { namespace gl
uint64_t GlContext::getCaps() const
{
+ uint64_t caps = 0;
+#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
NSWindow* nsWindow = (NSWindow*)g_platformData.nwh;
- uint64_t caps = 1.0f < [nsWindow backingScaleFactor]
- ? BGFX_CAPS_HIDPI
- : 0
- ;
+ if ([nsWindow respondsToSelector:@selector(backingScaleFactor)] && (1.0f < [nsWindow backingScaleFactor]))
+ caps |= BGFX_CAPS_HIDPI;
+#endif // defined(MAC_OS_X_VERSION_MAX_ALLOWED) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
return caps;
}