mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Made glfwGetWindowSize immediate.
Conflicts: src/internal.h
This commit is contained in:
+16
-2
@@ -690,8 +690,11 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||
styleMask |= NSResizableWindowMask;
|
||||
}
|
||||
|
||||
NSRect contentRect = NSMakeRect(wndconfig->positionX, wndconfig->positionY,
|
||||
wndconfig->width, wndconfig->height);
|
||||
|
||||
window->ns.object = [[NSWindow alloc]
|
||||
initWithContentRect:NSMakeRect(wndconfig->positionX, wndconfig->positionY, window->width, window->height)
|
||||
initWithContentRect:contentRect
|
||||
styleMask:styleMask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
@@ -773,7 +776,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
|
||||
{
|
||||
int bpp = colorBits + fbconfig->alphaBits;
|
||||
|
||||
if (!_glfwSetVideoMode(window->monitor, &window->width, &window->height, &bpp))
|
||||
if (!_glfwSetVideoMode(window->monitor, &window->videoMode.width, &window->videoMode.height, &bpp))
|
||||
return GL_FALSE;
|
||||
|
||||
_glfwPlatformShowWindow(window);
|
||||
@@ -819,6 +822,17 @@ void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char *title)
|
||||
[window->ns.object setTitle:[NSString stringWithUTF8String:title]];
|
||||
}
|
||||
|
||||
void _glfwPlatformGetWindowSize(_GLFWwindow* window, int* width, int* height)
|
||||
{
|
||||
NSRect contentRect =
|
||||
[window->ns.object contentRectForFrameRect:[window->ns.object frame]];
|
||||
|
||||
if (width)
|
||||
*width = contentRect.size.width;
|
||||
if (height)
|
||||
*height = contentRect.size.height;
|
||||
}
|
||||
|
||||
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||
{
|
||||
[window->ns.object setContentSize:NSMakeSize(width, height)];
|
||||
|
||||
Reference in New Issue
Block a user