mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
Renamed GLFW_WINDOW_NO_RESIZE to GLFW_WINDOW_RESIZABLE.
This commit is contained in:
parent
2660b27cf3
commit
a18cd1b14c
|
@ -583,7 +583,7 @@ int main(int argc, char** argv)
|
||||||
exit(EXIT_FAILURE);
|
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_MAJOR, 3);
|
||||||
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
|
||||||
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
glfwOpenWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||||
|
|
|
@ -418,7 +418,7 @@ extern "C" {
|
||||||
#define GLFW_ACCUM_ALPHA_BITS 0x0002100A
|
#define GLFW_ACCUM_ALPHA_BITS 0x0002100A
|
||||||
#define GLFW_AUX_BUFFERS 0x0002100B
|
#define GLFW_AUX_BUFFERS 0x0002100B
|
||||||
#define GLFW_STEREO 0x0002100C
|
#define GLFW_STEREO 0x0002100C
|
||||||
#define GLFW_WINDOW_NO_RESIZE 0x0002100D
|
#define GLFW_WINDOW_RESIZABLE 0x0002100D
|
||||||
#define GLFW_FSAA_SAMPLES 0x0002100E
|
#define GLFW_FSAA_SAMPLES 0x0002100E
|
||||||
#define GLFW_OPENGL_VERSION_MAJOR 0x0002100F
|
#define GLFW_OPENGL_VERSION_MAJOR 0x0002100F
|
||||||
#define GLFW_OPENGL_VERSION_MINOR 0x00021010
|
#define GLFW_OPENGL_VERSION_MINOR 0x00021010
|
||||||
|
|
|
@ -287,6 +287,7 @@ version of GLFW.</p>
|
||||||
<li>Changed buffer bit depth parameters of <code>glfwOpenWindow</code> to window hints</li>
|
<li>Changed buffer bit depth parameters of <code>glfwOpenWindow</code> to window hints</li>
|
||||||
<li>Renamed <code>glfw.h</code> to <code>glfw3.h</code> to avoid conflicts with 2.x series</li>
|
<li>Renamed <code>glfw.h</code> to <code>glfw3.h</code> to avoid conflicts with 2.x series</li>
|
||||||
<li>Renamed <code>GLFW_WINDOW</code> token to <code>GLFW_WINDOWED</code></li>
|
<li>Renamed <code>GLFW_WINDOW</code> token to <code>GLFW_WINDOWED</code></li>
|
||||||
|
<li>Renamed <code>GLFW_WINDOW_NO_RESIZE</code> to <code>GLFW_WINDOW_RESIZABLE</code></li>
|
||||||
<li>Renamed <code>version</code> test to <code>glfwinfo</code></li>
|
<li>Renamed <code>version</code> test to <code>glfwinfo</code></li>
|
||||||
<li>Replaced ad hoc build system with CMake</li>
|
<li>Replaced ad hoc build system with CMake</li>
|
||||||
<li>Replaced layout-dependent key codes with single, platform-independent set based on US layout</li>
|
<li>Replaced layout-dependent key codes with single, platform-independent set based on US layout</li>
|
||||||
|
|
|
@ -568,7 +568,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
|
||||||
styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
||||||
NSMiniaturizableWindowMask;
|
NSMiniaturizableWindowMask;
|
||||||
|
|
||||||
if (!wndconfig->windowNoResize)
|
if (wndconfig->resizable)
|
||||||
styleMask |= NSResizableWindowMask;
|
styleMask |= NSResizableWindowMask;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -691,7 +691,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
|
||||||
window->cursorPosX = point.x;
|
window->cursorPosX = point.x;
|
||||||
window->cursorPosY = point.y;
|
window->cursorPosY = point.y;
|
||||||
|
|
||||||
window->windowNoResize = wndconfig->windowNoResize;
|
window->resizable = wndconfig->resizable;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ struct _GLFWhints
|
||||||
int accumAlphaBits;
|
int accumAlphaBits;
|
||||||
int auxBuffers;
|
int auxBuffers;
|
||||||
GLboolean stereo;
|
GLboolean stereo;
|
||||||
GLboolean windowNoResize;
|
GLboolean resizable;
|
||||||
int samples;
|
int samples;
|
||||||
int glMajor;
|
int glMajor;
|
||||||
int glMinor;
|
int glMinor;
|
||||||
|
@ -125,7 +125,7 @@ struct _GLFWwndconfig
|
||||||
int mode;
|
int mode;
|
||||||
const char* title;
|
const char* title;
|
||||||
int refreshRate;
|
int refreshRate;
|
||||||
GLboolean windowNoResize;
|
GLboolean resizable;
|
||||||
int glMajor;
|
int glMajor;
|
||||||
int glMinor;
|
int glMinor;
|
||||||
GLboolean glForward;
|
GLboolean glForward;
|
||||||
|
@ -175,7 +175,7 @@ struct _GLFWwindow
|
||||||
int width, height;
|
int width, height;
|
||||||
int positionX, positionY;
|
int positionX, positionY;
|
||||||
int mode; // GLFW_WINDOW or GLFW_FULLSCREEN
|
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
|
int refreshRate; // monitor refresh rate
|
||||||
void* userPointer;
|
void* userPointer;
|
||||||
|
|
||||||
|
|
|
@ -1309,7 +1309,7 @@ static int createWindow(_GLFWwindow* window,
|
||||||
{
|
{
|
||||||
dwStyle |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
|
dwStyle |= WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
|
||||||
|
|
||||||
if (!wndconfig->windowNoResize)
|
if (wndconfig->resizable)
|
||||||
{
|
{
|
||||||
dwStyle |= (WS_MAXIMIZEBOX | WS_SIZEBOX);
|
dwStyle |= (WS_MAXIMIZEBOX | WS_SIZEBOX);
|
||||||
dwExStyle |= WS_EX_WINDOWEDGE;
|
dwExStyle |= WS_EX_WINDOWEDGE;
|
||||||
|
|
13
src/window.c
13
src/window.c
|
@ -100,6 +100,9 @@ void _glfwSetDefaultWindowHints(void)
|
||||||
// The default minimum OpenGL version is 1.0
|
// The default minimum OpenGL version is 1.0
|
||||||
_glfwLibrary.hints.glMajor = 1;
|
_glfwLibrary.hints.glMajor = 1;
|
||||||
_glfwLibrary.hints.glMinor = 0;
|
_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.mode = mode;
|
||||||
wndconfig.title = title;
|
wndconfig.title = title;
|
||||||
wndconfig.refreshRate = Max(_glfwLibrary.hints.refreshRate, 0);
|
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.glMajor = _glfwLibrary.hints.glMajor;
|
||||||
wndconfig.glMinor = _glfwLibrary.hints.glMinor;
|
wndconfig.glMinor = _glfwLibrary.hints.glMinor;
|
||||||
wndconfig.glForward = _glfwLibrary.hints.glForward ? GL_TRUE : GL_FALSE;
|
wndconfig.glForward = _glfwLibrary.hints.glForward ? GL_TRUE : GL_FALSE;
|
||||||
|
@ -419,8 +422,8 @@ GLFWAPI void glfwOpenWindowHint(int target, int hint)
|
||||||
case GLFW_STEREO:
|
case GLFW_STEREO:
|
||||||
_glfwLibrary.hints.stereo = hint;
|
_glfwLibrary.hints.stereo = hint;
|
||||||
break;
|
break;
|
||||||
case GLFW_WINDOW_NO_RESIZE:
|
case GLFW_WINDOW_RESIZABLE:
|
||||||
_glfwLibrary.hints.windowNoResize = hint;
|
_glfwLibrary.hints.resizable = hint;
|
||||||
break;
|
break;
|
||||||
case GLFW_FSAA_SAMPLES:
|
case GLFW_FSAA_SAMPLES:
|
||||||
_glfwLibrary.hints.samples = hint;
|
_glfwLibrary.hints.samples = hint;
|
||||||
|
@ -707,8 +710,8 @@ GLFWAPI int glfwGetWindowParam(GLFWwindow handle, int param)
|
||||||
return window->stereo;
|
return window->stereo;
|
||||||
case GLFW_REFRESH_RATE:
|
case GLFW_REFRESH_RATE:
|
||||||
return window->refreshRate;
|
return window->refreshRate;
|
||||||
case GLFW_WINDOW_NO_RESIZE:
|
case GLFW_WINDOW_RESIZABLE:
|
||||||
return window->windowNoResize;
|
return window->resizable;
|
||||||
case GLFW_FSAA_SAMPLES:
|
case GLFW_FSAA_SAMPLES:
|
||||||
return window->samples;
|
return window->samples;
|
||||||
case GLFW_OPENGL_VERSION_MAJOR:
|
case GLFW_OPENGL_VERSION_MAJOR:
|
||||||
|
|
|
@ -794,7 +794,7 @@ static GLboolean createWindow(_GLFWwindow* window,
|
||||||
|
|
||||||
hints->flags = 0;
|
hints->flags = 0;
|
||||||
|
|
||||||
if (wndconfig->windowNoResize)
|
if (!wndconfig->resizable)
|
||||||
{
|
{
|
||||||
hints->flags |= (PMinSize | PMaxSize);
|
hints->flags |= (PMinSize | PMaxSize);
|
||||||
hints->min_width = hints->max_width = window->width;
|
hints->min_width = hints->max_width = window->width;
|
||||||
|
@ -1392,7 +1392,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
|
||||||
_GLFWfbconfig closest;
|
_GLFWfbconfig closest;
|
||||||
|
|
||||||
window->refreshRate = wndconfig->refreshRate;
|
window->refreshRate = wndconfig->refreshRate;
|
||||||
window->windowNoResize = wndconfig->windowNoResize;
|
window->resizable = wndconfig->resizable;
|
||||||
|
|
||||||
initGLXExtensions(window);
|
initGLXExtensions(window);
|
||||||
|
|
||||||
|
@ -1533,7 +1533,7 @@ void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height)
|
||||||
&width, &height, &rate);
|
&width, &height, &rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window->windowNoResize)
|
if (!window->resizable)
|
||||||
{
|
{
|
||||||
// Update window size restrictions to match new window size
|
// Update window size restrictions to match new window size
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user