mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Support OSX versions before high-DPI support was added
This commit is contained in:
parent
d9614c7b57
commit
79c674bf12
1 changed files with 9 additions and 5 deletions
|
@ -134,9 +134,12 @@ namespace bgfx { namespace gl
|
||||||
{
|
{
|
||||||
BX_UNUSED(_width, _height);
|
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);
|
bool hidpi = !!(_flags&BGFX_RESET_HIDPI);
|
||||||
NSOpenGLView* glView = (NSOpenGLView*)m_view;
|
NSOpenGLView* glView = (NSOpenGLView*)m_view;
|
||||||
|
if ([glView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
|
||||||
[glView setWantsBestResolutionOpenGLSurface:hidpi];
|
[glView setWantsBestResolutionOpenGLSurface:hidpi];
|
||||||
|
#endif // defined(MAC_OS_X_VERSION_MAX_ALLOWED) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
|
||||||
|
|
||||||
bool vsync = !!(_flags&BGFX_RESET_VSYNC);
|
bool vsync = !!(_flags&BGFX_RESET_VSYNC);
|
||||||
GLint interval = vsync ? 1 : 0;
|
GLint interval = vsync ? 1 : 0;
|
||||||
|
@ -147,11 +150,12 @@ namespace bgfx { namespace gl
|
||||||
|
|
||||||
uint64_t GlContext::getCaps() const
|
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;
|
NSWindow* nsWindow = (NSWindow*)g_platformData.nwh;
|
||||||
uint64_t caps = 1.0f < [nsWindow backingScaleFactor]
|
if ([nsWindow respondsToSelector:@selector(backingScaleFactor)] && (1.0f < [nsWindow backingScaleFactor]))
|
||||||
? BGFX_CAPS_HIDPI
|
caps |= BGFX_CAPS_HIDPI;
|
||||||
: 0
|
#endif // defined(MAC_OS_X_VERSION_MAX_ALLOWED) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 1070)
|
||||||
;
|
|
||||||
return caps;
|
return caps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue