mirror of
https://github.com/glfw/glfw.git
synced 2025-07-29 11:00:04 +00:00
Merge 073aeb6828
into 61f7de5a25
This commit is contained in:
commit
0e8902bf43
@ -32,7 +32,6 @@
|
|||||||
// Needed for _NSGetProgname
|
// Needed for _NSGetProgname
|
||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
|
|
||||||
|
|
||||||
// Enter fullscreen mode
|
// Enter fullscreen mode
|
||||||
//
|
//
|
||||||
static void enterFullscreenMode(_GLFWwindow* window)
|
static void enterFullscreenMode(_GLFWwindow* window)
|
||||||
@ -112,7 +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];
|
||||||
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect];
|
const NSRect fbRect = [window->ns.view respondsToSelector:@selector(convertRectToBacking:)]
|
||||||
|
? [window->ns.view convertRectToBacking:contentRect]
|
||||||
|
: contentRect;
|
||||||
|
|
||||||
_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);
|
||||||
@ -524,8 +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];
|
||||||
const NSRect fbRect = [window->ns.view convertRectToBacking:contentRect];
|
const NSRect fbRect = [window->ns.view respondsToSelector:@selector(convertRectToBacking:)]
|
||||||
|
? [window->ns.view convertRectToBacking:contentRect]
|
||||||
|
: contentRect;
|
||||||
|
|
||||||
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
|
_glfwInputFramebufferSize(window, fbRect.size.width, fbRect.size.height);
|
||||||
}
|
}
|
||||||
@ -814,8 +817,9 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
}
|
}
|
||||||
|
|
||||||
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
window->ns.view = [[GLFWContentView alloc] initWithGlfwWindow:window];
|
||||||
|
|
||||||
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
if ([window->ns.view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
|
||||||
|
[window->ns.view setWantsBestResolutionOpenGLSurface:YES];
|
||||||
|
|
||||||
[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];
|
||||||
@ -823,7 +827,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
|||||||
[window->ns.object setAcceptsMouseMovedEvents:YES];
|
[window->ns.object setAcceptsMouseMovedEvents:YES];
|
||||||
[window->ns.object disableCursorRects];
|
[window->ns.object disableCursorRects];
|
||||||
[window->ns.object center];
|
[window->ns.object center];
|
||||||
|
|
||||||
if ([window->ns.object respondsToSelector:@selector(setRestorable:)])
|
if ([window->ns.object respondsToSelector:@selector(setRestorable:)])
|
||||||
[window->ns.object setRestorable:NO];
|
[window->ns.object setRestorable:NO];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user