From a18cd1b14c7ed4f8006d8f7a4d1aeb5cf47b8d45 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Wed, 2 Nov 2011 16:56:34 +0100 Subject: [PATCH] Renamed GLFW_WINDOW_NO_RESIZE to GLFW_WINDOW_RESIZABLE. --- examples/heightmap.c | 2 +- include/GL/glfw3.h | 2 +- readme.html | 1 + src/cocoa_window.m | 4 ++-- src/internal.h | 6 +++--- src/win32_window.c | 2 +- src/window.c | 13 ++++++++----- src/x11_window.c | 8 ++++---- 8 files changed, 21 insertions(+), 17 deletions(-) diff --git a/examples/heightmap.c b/examples/heightmap.c index 1d3dd72e..b4dcf082 100644 --- a/examples/heightmap.c +++ b/examples/heightmap.c @@ -583,7 +583,7 @@ int main(int argc, char** argv) exit(EXIT_FAILURE); } - glfwOpenWindowHint(GLFW_WINDOW_NO_RESIZE, GL_TRUE); + glfwOpenWindowHint(GLFW_WINDOW_RESIZABLE, GL_FALSE); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3); glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2); glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h index 1f52e742..88729631 100644 --- a/include/GL/glfw3.h +++ b/include/GL/glfw3.h @@ -418,7 +418,7 @@ extern "C" { #define GLFW_ACCUM_ALPHA_BITS 0x0002100A #define GLFW_AUX_BUFFERS 0x0002100B #define GLFW_STEREO 0x0002100C -#define GLFW_WINDOW_NO_RESIZE 0x0002100D +#define GLFW_WINDOW_RESIZABLE 0x0002100D #define GLFW_FSAA_SAMPLES 0x0002100E #define GLFW_OPENGL_VERSION_MAJOR 0x0002100F #define GLFW_OPENGL_VERSION_MINOR 0x00021010 diff --git a/readme.html b/readme.html index a028b45b..21f043a3 100644 --- a/readme.html +++ b/readme.html @@ -287,6 +287,7 @@ version of GLFW.

  • Changed buffer bit depth parameters of glfwOpenWindow to window hints
  • Renamed glfw.h to glfw3.h to avoid conflicts with 2.x series
  • Renamed GLFW_WINDOW token to GLFW_WINDOWED
  • +
  • Renamed GLFW_WINDOW_NO_RESIZE to GLFW_WINDOW_RESIZABLE
  • Renamed version test to glfwinfo
  • Replaced ad hoc build system with CMake
  • Replaced layout-dependent key codes with single, platform-independent set based on US layout
  • diff --git a/src/cocoa_window.m b/src/cocoa_window.m index 4f662faf..ce95217d 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -568,7 +568,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window, styleMask = NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask; - if (!wndconfig->windowNoResize) + if (wndconfig->resizable) styleMask |= NSResizableWindowMask; } else @@ -691,7 +691,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window, window->cursorPosX = point.x; window->cursorPosY = point.y; - window->windowNoResize = wndconfig->windowNoResize; + window->resizable = wndconfig->resizable; return GL_TRUE; } diff --git a/src/internal.h b/src/internal.h index 3c27bba1..5992a0f4 100644 --- a/src/internal.h +++ b/src/internal.h @@ -103,7 +103,7 @@ struct _GLFWhints int accumAlphaBits; int auxBuffers; GLboolean stereo; - GLboolean windowNoResize; + GLboolean resizable; int samples; int glMajor; int glMinor; @@ -125,7 +125,7 @@ struct _GLFWwndconfig int mode; const char* title; int refreshRate; - GLboolean windowNoResize; + GLboolean resizable; int glMajor; int glMinor; GLboolean glForward; @@ -175,7 +175,7 @@ struct _GLFWwindow int width, height; int positionX, positionY; int mode; // GLFW_WINDOW or GLFW_FULLSCREEN - GLboolean windowNoResize; // resize- and maximize gadgets disabled flag + GLboolean resizable; // GL_TRUE if user may resize this window int refreshRate; // monitor refresh rate void* userPointer; diff --git a/src/win32_window.c b/src/win32_window.c index d81da139..e2619acf 100644 --- a/src/win32_window.c +++ b/src/win32_window.c @@ -1309,7 +1309,7 @@ static int createWindow(_GLFWwindow* window, { dwStyle |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; - if (!wndconfig->windowNoResize) + if (wndconfig->resizable) { dwStyle |= (WS_MAXIMIZEBOX | WS_SIZEBOX); dwExStyle |= WS_EX_WINDOWEDGE; diff --git a/src/window.c b/src/window.c index 68893f09..88b3dc18 100644 --- a/src/window.c +++ b/src/window.c @@ -100,6 +100,9 @@ void _glfwSetDefaultWindowHints(void) // The default minimum OpenGL version is 1.0 _glfwLibrary.hints.glMajor = 1; _glfwLibrary.hints.glMinor = 0; + + // The default is to allow window resizing + _glfwLibrary.hints.resizable = GL_TRUE; } @@ -247,7 +250,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, wndconfig.mode = mode; wndconfig.title = title; wndconfig.refreshRate = Max(_glfwLibrary.hints.refreshRate, 0); - wndconfig.windowNoResize = _glfwLibrary.hints.windowNoResize ? GL_TRUE : GL_FALSE; + wndconfig.resizable = _glfwLibrary.hints.resizable ? GL_TRUE : GL_FALSE; wndconfig.glMajor = _glfwLibrary.hints.glMajor; wndconfig.glMinor = _glfwLibrary.hints.glMinor; wndconfig.glForward = _glfwLibrary.hints.glForward ? GL_TRUE : GL_FALSE; @@ -419,8 +422,8 @@ GLFWAPI void glfwOpenWindowHint(int target, int hint) case GLFW_STEREO: _glfwLibrary.hints.stereo = hint; break; - case GLFW_WINDOW_NO_RESIZE: - _glfwLibrary.hints.windowNoResize = hint; + case GLFW_WINDOW_RESIZABLE: + _glfwLibrary.hints.resizable = hint; break; case GLFW_FSAA_SAMPLES: _glfwLibrary.hints.samples = hint; @@ -707,8 +710,8 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param) return window->stereo; case GLFW_REFRESH_RATE: return window->refreshRate; - case GLFW_WINDOW_NO_RESIZE: - return window->windowNoResize; + case GLFW_WINDOW_RESIZABLE: + return window->resizable; case GLFW_FSAA_SAMPLES: return window->samples; case GLFW_OPENGL_VERSION_MAJOR: diff --git a/src/x11_window.c b/src/x11_window.c index 3ce5e832..effff0f9 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -794,7 +794,7 @@ static GLboolean createWindow(_GLFWwindow* window, hints->flags = 0; - if (wndconfig->windowNoResize) + if (!wndconfig->resizable) { hints->flags |= (PMinSize | PMaxSize); hints->min_width = hints->max_width = window->width; @@ -1391,8 +1391,8 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window, { _GLFWfbconfig closest; - window->refreshRate = wndconfig->refreshRate; - window->windowNoResize = wndconfig->windowNoResize; + window->refreshRate = wndconfig->refreshRate; + window->resizable = wndconfig->resizable; initGLXExtensions(window); @@ -1533,7 +1533,7 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height) &width, &height, &rate); } - if (window->windowNoResize) + if (!window->resizable) { // Update window size restrictions to match new window size