mirror of
https://github.com/glfw/glfw.git
synced 2025-07-29 11:00:04 +00:00
checking capabilities at run time instead, based on suggestions from @nilium
This commit is contained in:
parent
f03d9990b6
commit
073aeb6828
@ -111,11 +111,9 @@ static void centerCursor(_GLFWwindow *window)
|
|||||||
[window->nsgl.context update];
|
[window->nsgl.context update];
|
||||||
|
|
||||||
const NSRect contentRect = [window->ns.view frame];
|
const NSRect contentRect = [window->ns.view frame];
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
const NSRect fbRect = [window->ns.view respondsToSelector:@selector(convertRectToBacking:)]
|
||||||
const NSRect fbRect = contentRect;
|
? [window->ns.view convertRectToBacking:contentRect]
|
||||||
#else
|
: contentRect;
|
||||||
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
|
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
|
||||||
_glfwInputWindowSize(window, contentRect.size.width, contentRect.size.height);
|
_glfwInputWindowSize(window, contentRect.size.width, contentRect.size.height);
|
||||||
@ -527,12 +525,10 @@ static int translateKey(unsigned int key)
|
|||||||
|
|
||||||
- (void)viewDidChangeBackingProperties
|
- (void)viewDidChangeBackingProperties
|
||||||
{
|
{
|
||||||
const NSRect contentRect = [window->ns.view frame];
|
const NSRect contentRect = [window->ns.view frame];
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
const NSRect fbRect = [window->ns.view respondsToSelector:@selector(convertRectToBacking:)]
|
||||||
const NSRect fbRect = contentRect;
|
? [window->ns.view convertRectToBacking:contentRect]
|
||||||
#else
|
: contentRect;
|
||||||
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
|
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
|
||||||
}
|
}
|
||||||
@ -821,10 +817,9 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
|
||||||
#else
|
if ([window->ns.view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
|
||||||
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
||||||
#endif
|
|
||||||
|
|
||||||
[window->ns.object setTitle:[NSString stringWithUTF8String:wndconfig->title]];
|
[window->ns.object setTitle:[NSString stringWithUTF8String:wndconfig->title]];
|
||||||
[window->ns.object setContentView:window->ns.view];
|
[window->ns.object setContentView:window->ns.view];
|
||||||
@ -833,11 +828,8 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
[window->ns.object disableCursorRects];
|
[window->ns.object disableCursorRects];
|
||||||
[window->ns.object center];
|
[window->ns.object center];
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
|
||||||
#else
|
|
||||||
if ([window->ns.object respondsToSelector:@selector(setRestorable:)])
|
if ([window->ns.object respondsToSelector:@selector(setRestorable:)])
|
||||||
[window->ns.object setRestorable:NO];
|
[window->ns.object setRestorable:NO];
|
||||||
#endif
|
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user