From aff30d0baa42af743c1ed956fa6e517f35e37a4d Mon Sep 17 00:00:00 2001
From: Camilla Berglund
Date: Mon, 6 Aug 2012 17:56:41 +0200
Subject: [PATCH] Renamed window creation/destruction functions.
Renamed glfwOpenWindow to glfwCreateWindow.
Renamed glfwCloseWindow to glfwDestroyWindow.
Renamed glfwOpenWindowHint to glfwWindowHint.
---
examples/boing.c | 4 ++--
examples/gears.c | 4 ++--
examples/heightmap.c | 12 ++++++------
examples/particles.c | 2 +-
examples/pong3d.c | 2 +-
examples/splitview.c | 4 ++--
examples/triangle.c | 2 +-
examples/wave.c | 2 +-
include/GL/glfw3.h | 10 +++++-----
readme.html | 4 ++--
src/cocoa_window.m | 8 ++++----
src/init.c | 2 +-
src/internal.h | 8 ++++----
src/opengl.c | 28 ++++++++++++++--------------
src/win32_opengl.c | 2 +-
src/win32_window.c | 12 ++++++------
src/window.c | 28 ++++++++++++++--------------
src/x11_window.c | 8 ++++----
tests/accuracy.c | 2 +-
tests/clipboard.c | 4 ++--
tests/defaults.c | 4 ++--
tests/events.c | 2 +-
tests/fsaa.c | 4 ++--
tests/fsfocus.c | 2 +-
tests/gamma.c | 4 ++--
tests/glfwinfo.c | 14 +++++++-------
tests/iconify.c | 4 ++--
tests/joysticks.c | 2 +-
tests/modes.c | 16 ++++++++--------
tests/peter.c | 4 ++--
tests/reopen.c | 4 ++--
tests/sharing.c | 4 ++--
tests/tearing.c | 2 +-
tests/title.c | 2 +-
tests/windows.c | 2 +-
35 files changed, 109 insertions(+), 109 deletions(-)
diff --git a/examples/boing.c b/examples/boing.c
index 6dbca066..bd6d4d29 100644
--- a/examples/boing.c
+++ b/examples/boing.c
@@ -587,9 +587,9 @@ int main( void )
exit( EXIT_FAILURE );
}
- glfwOpenWindowHint(GLFW_DEPTH_BITS, 16);
+ glfwWindowHint(GLFW_DEPTH_BITS, 16);
- window = glfwOpenWindow( 400, 400, GLFW_WINDOWED, "Boing (classic Amiga demo)", NULL );
+ window = glfwCreateWindow( 400, 400, GLFW_WINDOWED, "Boing (classic Amiga demo)", NULL );
if (!window)
{
fprintf( stderr, "Failed to open GLFW window\n" );
diff --git a/examples/gears.c b/examples/gears.c
index 9d9c7d60..6fecb646 100644
--- a/examples/gears.c
+++ b/examples/gears.c
@@ -337,9 +337,9 @@ int main(int argc, char *argv[])
exit( EXIT_FAILURE );
}
- glfwOpenWindowHint(GLFW_DEPTH_BITS, 16);
+ glfwWindowHint(GLFW_DEPTH_BITS, 16);
- window = glfwOpenWindow( 300, 300, GLFW_WINDOWED, "Gears", NULL );
+ window = glfwCreateWindow( 300, 300, GLFW_WINDOWED, "Gears", NULL );
if (!window)
{
fprintf( stderr, "Failed to open GLFW window\n" );
diff --git a/examples/heightmap.c b/examples/heightmap.c
index e926581a..7b03a1b3 100644
--- a/examples/heightmap.c
+++ b/examples/heightmap.c
@@ -581,13 +581,13 @@ int main(int argc, char** argv)
exit(EXIT_FAILURE);
}
- 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);
- glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);
+ glfwWindowHint(GLFW_WINDOW_RESIZABLE, GL_FALSE);
+ glfwWindowHint(GLFW_OPENGL_VERSION_MAJOR, 3);
+ glfwWindowHint(GLFW_OPENGL_VERSION_MINOR, 2);
+ glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
+ glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_FALSE);
- window = glfwOpenWindow(800, 600, GLFW_WINDOWED, "GLFW OpenGL3 Heightmap demo", NULL);
+ window = glfwCreateWindow(800, 600, GLFW_WINDOWED, "GLFW OpenGL3 Heightmap demo", NULL);
if (! window )
{
fprintf(stderr, "ERROR: Unable to create the OpenGL context and associated window\n");
diff --git a/examples/particles.c b/examples/particles.c
index 403a9997..c7904e11 100644
--- a/examples/particles.c
+++ b/examples/particles.c
@@ -1028,7 +1028,7 @@ int main( int argc, char **argv )
}
// Open OpenGL fullscreen window
- if( !glfwOpenWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
+ if( !glfwCreateWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
{
fprintf( stderr, "Failed to open GLFW window\n" );
glfwTerminate();
diff --git a/examples/pong3d.c b/examples/pong3d.c
index 1d1afd1f..58c9ee20 100644
--- a/examples/pong3d.c
+++ b/examples/pong3d.c
@@ -810,7 +810,7 @@ int main( void )
}
// Open OpenGL window
- if( !glfwOpenWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
+ if( !glfwCreateWindow( WIDTH, HEIGHT, 0,0,0,0, 16,0, GLFW_FULLSCREEN ) )
{
fprintf( stderr, "Failed to open GLFW window\n" );
glfwTerminate();
diff --git a/examples/splitview.c b/examples/splitview.c
index d9595717..2ab3a82c 100644
--- a/examples/splitview.c
+++ b/examples/splitview.c
@@ -464,10 +464,10 @@ int main(void)
exit(EXIT_FAILURE);
}
- glfwOpenWindowHint(GLFW_DEPTH_BITS, 16);
+ glfwWindowHint(GLFW_DEPTH_BITS, 16);
// Open OpenGL window
- window = glfwOpenWindow(500, 500, GLFW_WINDOWED, "Split view demo", NULL);
+ window = glfwCreateWindow(500, 500, GLFW_WINDOWED, "Split view demo", NULL);
if (!window)
{
fprintf(stderr, "Failed to open GLFW window\n");
diff --git a/examples/triangle.c b/examples/triangle.c
index bf26a94e..212f5df3 100644
--- a/examples/triangle.c
+++ b/examples/triangle.c
@@ -31,7 +31,7 @@ int main(void)
}
// Open a window and create its OpenGL context
- window = glfwOpenWindow(640, 480, GLFW_WINDOWED, "Spinning Triangle", NULL);
+ window = glfwCreateWindow(640, 480, GLFW_WINDOWED, "Spinning Triangle", NULL);
if (!window)
{
fprintf(stderr, "Failed to open GLFW window\n");
diff --git a/examples/wave.c b/examples/wave.c
index 00e74039..d58f1711 100644
--- a/examples/wave.c
+++ b/examples/wave.c
@@ -398,7 +398,7 @@ int main(int argc, char* argv[])
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(640, 480, GLFW_WINDOWED, "Wave Simulation", NULL);
+ window = glfwCreateWindow(640, 480, GLFW_WINDOWED, "Wave Simulation", NULL);
if (!window)
{
fprintf(stderr, "Could not open window\n");
diff --git a/include/GL/glfw3.h b/include/GL/glfw3.h
index f1d9f5cc..49e2bdf3 100644
--- a/include/GL/glfw3.h
+++ b/include/GL/glfw3.h
@@ -381,7 +381,7 @@ extern "C" {
* Other definitions
*************************************************************************/
-/* glfwOpenWindow modes */
+/* glfwCreateWindow modes */
#define GLFW_WINDOWED 0x00010001
#define GLFW_FULLSCREEN 0x00010002
@@ -391,7 +391,7 @@ extern "C" {
#define GLFW_OPENGL_REVISION 0x00020004
/* The following constants are used for both glfwGetWindowParam
- * and glfwOpenWindowHint
+ * and glfwWindowHint
*/
#define GLFW_RED_BITS 0x00021000
#define GLFW_GREEN_BITS 0x00021001
@@ -527,9 +527,9 @@ GLFWAPI void glfwGetGammaRamp(GLFWgammaramp* ramp);
GLFWAPI void glfwSetGammaRamp(const GLFWgammaramp* ramp);
/* Window handling */
-GLFWAPI GLFWwindow glfwOpenWindow(int width, int height, int mode, const char* title, GLFWwindow share);
-GLFWAPI void glfwOpenWindowHint(int target, int hint);
-GLFWAPI void glfwCloseWindow(GLFWwindow window);
+GLFWAPI GLFWwindow glfwCreateWindow(int width, int height, int mode, const char* title, GLFWwindow share);
+GLFWAPI void glfwWindowHint(int target, int hint);
+GLFWAPI void glfwDestroyWindow(GLFWwindow window);
GLFWAPI void glfwSetWindowTitle(GLFWwindow, const char* title);
GLFWAPI void glfwGetWindowSize(GLFWwindow, int* width, int* height);
GLFWAPI void glfwSetWindowSize(GLFWwindow, int width, int height);
diff --git a/readme.html b/readme.html
index 9627ecb6..c5447a20 100644
--- a/readme.html
+++ b/readme.html
@@ -287,20 +287,20 @@ version of GLFW.
Added sharing
simple OpenGL object sharing test program
Added modes
video mode enumeration and setting test program
Added glfw3native.h
header and platform-specific functions for explicit access to native display, window and context handles
- Added a parameter to glfwOpenWindow
for specifying a context the new window's context will share objects with
- Added initial window title parameter to glfwOpenWindow
Added glfwSetGamma
, glfwSetGammaRamp
and glfwGetGammaRamp
functions and GLFWgammaramp
type for monitor gamma ramp control
Changed buffer bit depth parameters of glfwOpenWindow
to window hints
Changed glfwOpenWindow
and glfwSetWindowTitle
to use UTF-8 encoded strings
Changed glfwGetProcAddress
to return a (generic) function pointer
Changed glfwGetVideoModes
to return a dynamic, unlimited number of video modes
Renamed glfw.h
to glfw3.h
to avoid conflicts with 2.x series
+ Renamed glfwOpenWindowHint
to glfwWindowHint
Renamed GLFW_WINDOW
token to GLFW_WINDOWED
Renamed GLFW_WINDOW_NO_RESIZE
to GLFW_WINDOW_RESIZABLE
Renamed GLFW_BUILD_DLL
to _GLFW_BUILD_DLL
Renamed version
test to glfwinfo
Renamed GLFW_NO_GLU
to GLFW_INCLUDE_GLU
and made it disabled by default
Renamed mouse position functions to cursor position equivalents
+ Replaced glfwOpenWindow
and glfwCloseWindow
with glfwCreateWindow
and glfwDestroyWindow
Replaced ad hoc build system with CMake
Replaced layout-dependent key codes with single, platform-independent set based on US layout
Replaced mouse wheel interface with two-dimensional, floating point scrolling interface
diff --git a/src/cocoa_window.m b/src/cocoa_window.m
index 2f6b851c..0d8ec67d 100644
--- a/src/cocoa_window.m
+++ b/src/cocoa_window.m
@@ -860,9 +860,9 @@ static GLboolean createContext(_GLFWwindow* window,
// created
//========================================================================
-int _glfwPlatformOpenWindow(_GLFWwindow* window,
- const _GLFWwndconfig* wndconfig,
- const _GLFWfbconfig* fbconfig)
+int _glfwPlatformCreateWindow(_GLFWwindow* window,
+ const _GLFWwndconfig* wndconfig,
+ const _GLFWfbconfig* fbconfig)
{
if (!initializeAppKit())
return GL_FALSE;
@@ -944,7 +944,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
// Properly kill the window / video display
//========================================================================
-void _glfwPlatformCloseWindow(_GLFWwindow* window)
+void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
[window->NS.object orderOut:nil];
diff --git a/src/init.c b/src/init.c
index eab5869f..e1d5dfc9 100644
--- a/src/init.c
+++ b/src/init.c
@@ -79,7 +79,7 @@ GLFWAPI void glfwTerminate(void)
// Close all remaining windows
while (_glfwLibrary.windowListHead)
- glfwCloseWindow(_glfwLibrary.windowListHead);
+ glfwDestroyWindow(_glfwLibrary.windowListHead);
if (!_glfwPlatformTerminate())
return;
diff --git a/src/internal.h b/src/internal.h
index 81eb26c6..5d22e15e 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -88,10 +88,10 @@ typedef struct _GLFWlibrary _GLFWlibrary;
//------------------------------------------------------------------------
-// Window hints, set by glfwOpenWindowHint and consumed by glfwOpenWindow
+// Window hints, set by glfwWindowHint and consumed by glfwCreateWindow
// A bucket of semi-random stuff lumped together for historical reasons
// This is used only by the platform independent code and only to store
-// parameters passed to us by glfwOpenWindowHint
+// parameters passed to us by glfwWindowHint
//------------------------------------------------------------------------
struct _GLFWhints
{
@@ -310,8 +310,8 @@ double _glfwPlatformGetTime(void);
void _glfwPlatformSetTime(double time);
// Window management
-int _glfwPlatformOpenWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig);
-void _glfwPlatformCloseWindow(_GLFWwindow* window);
+int _glfwPlatformCreateWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig, const _GLFWfbconfig* fbconfig);
+void _glfwPlatformDestroyWindow(_GLFWwindow* window);
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title);
void _glfwPlatformSetWindowSize(_GLFWwindow* window, int width, int height);
void _glfwPlatformSetWindowPos(_GLFWwindow* window, int x, int y);
diff --git a/src/opengl.c b/src/opengl.c
index 59166bfa..24889e07 100644
--- a/src/opengl.c
+++ b/src/opengl.c
@@ -244,7 +244,7 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
//========================================================================
// Checks whether the OpenGL part of the window config is sane
-// It blames glfwOpenWindow because that's the only caller
+// It blames glfwCreateWindow because that's the only caller
//========================================================================
GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
@@ -253,28 +253,28 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
{
// OpenGL 1.0 is the smallest valid version
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Invalid OpenGL version requested");
+ "glfwCreateWindow: Invalid OpenGL version requested");
return GL_FALSE;
}
if (wndconfig->glMajor == 1 && wndconfig->glMinor > 5)
{
// OpenGL 1.x series ended with version 1.5
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Invalid OpenGL version requested");
+ "glfwCreateWindow: Invalid OpenGL version requested");
return GL_FALSE;
}
else if (wndconfig->glMajor == 2 && wndconfig->glMinor > 1)
{
// OpenGL 2.x series ended with version 2.1
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Invalid OpenGL version requested");
+ "glfwCreateWindow: Invalid OpenGL version requested");
return GL_FALSE;
}
else if (wndconfig->glMajor == 3 && wndconfig->glMinor > 3)
{
// OpenGL 3.x series ended with version 3.3
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Invalid OpenGL version requested");
+ "glfwCreateWindow: Invalid OpenGL version requested");
return GL_FALSE;
}
else
@@ -292,7 +292,7 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
// everything 2.x and let the driver report invalid 2.x versions
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Invalid OpenGL ES 2.x version requested");
+ "glfwCreateWindow: Invalid OpenGL ES 2.x version requested");
return GL_FALSE;
}
}
@@ -302,7 +302,7 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
wndconfig->glProfile != GLFW_OPENGL_COMPAT_PROFILE)
{
_glfwSetError(GLFW_INVALID_ENUM,
- "glfwOpenWindow: Invalid OpenGL profile requested");
+ "glfwCreateWindow: Invalid OpenGL profile requested");
return GL_FALSE;
}
@@ -313,7 +313,7 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
// and above
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Context profiles only exist for "
+ "glfwCreateWindow: Context profiles only exist for "
"OpenGL version 3.2 and above");
return GL_FALSE;
}
@@ -323,7 +323,7 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
{
// Forward-compatible contexts are only defined for OpenGL version 3.0 and above
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Forward compatibility only exist for "
+ "glfwCreateWindow: Forward compatibility only exist for "
"OpenGL version 3.0 and above");
return GL_FALSE;
}
@@ -334,7 +334,7 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
wndconfig->glRobustness != GLFW_OPENGL_LOSE_CONTEXT_ON_RESET)
{
_glfwSetError(GLFW_INVALID_VALUE,
- "glfwOpenWindow: Invalid OpenGL robustness mode requested");
+ "glfwCreateWindow: Invalid OpenGL robustness mode requested");
return GL_FALSE;
}
}
@@ -345,7 +345,7 @@ GLboolean _glfwIsValidContextConfig(_GLFWwndconfig* wndconfig)
//========================================================================
// Reads back context properties
-// It blames glfwOpenWindow because that's the only caller
+// It blames glfwCreateWindow because that's the only caller
//========================================================================
GLboolean _glfwRefreshContextParams(void)
@@ -369,7 +369,7 @@ GLboolean _glfwRefreshContextParams(void)
if (!window->GetStringi)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "glfwOpenWindow: Entry point retrieval is broken");
+ "glfwCreateWindow: Entry point retrieval is broken");
return GL_FALSE;
}
}
@@ -433,7 +433,7 @@ GLboolean _glfwRefreshContextParams(void)
//========================================================================
// Checks whether the current context fulfils the specified requirements
-// It blames glfwOpenWindow because that's the only caller
+// It blames glfwCreateWindow because that's the only caller
//========================================================================
GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig)
@@ -452,7 +452,7 @@ GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig)
// {GLX|WGL}_ARB_create_context extension and fail here
_glfwSetError(GLFW_VERSION_UNAVAILABLE,
- "glfwOpenWindow: The requested OpenGL version is not available");
+ "glfwCreateWindow: The requested OpenGL version is not available");
return GL_FALSE;
}
diff --git a/src/win32_opengl.c b/src/win32_opengl.c
index 11a45346..2d85369f 100644
--- a/src/win32_opengl.c
+++ b/src/win32_opengl.c
@@ -505,7 +505,7 @@ int _glfwCreateContext(_GLFWwindow* window,
void _glfwDestroyContext(_GLFWwindow* window)
{
- // This is duplicated from glfwCloseWindow
+ // This is duplicated from glfwDestroyWindow
// TODO: Stop duplicating code
if (window == _glfwLibrary.currentWindow)
glfwMakeContextCurrent(NULL);
diff --git a/src/win32_window.c b/src/win32_window.c
index aced1511..62a53c03 100755
--- a/src/win32_window.c
+++ b/src/win32_window.c
@@ -886,7 +886,7 @@ static int createWindow(_GLFWwindow* window,
if (!wideTitle)
{
_glfwSetError(GLFW_PLATFORM_ERROR,
- "glfwOpenWindow: Failed to convert title to wide string");
+ "glfwCreateWindow: Failed to convert title to wide string");
return GL_FALSE;
}
@@ -931,7 +931,7 @@ static void destroyWindow(_GLFWwindow* window)
{
_glfwDestroyContext(window);
- // This is duplicated from glfwCloseWindow
+ // This is duplicated from glfwDestroyWindow
// TODO: Stop duplicating code
if (window == _glfwLibrary.activeWindow)
_glfwLibrary.activeWindow = NULL;
@@ -953,9 +953,9 @@ static void destroyWindow(_GLFWwindow* window)
// created
//========================================================================
-int _glfwPlatformOpenWindow(_GLFWwindow* window,
- const _GLFWwndconfig* wndconfig,
- const _GLFWfbconfig* fbconfig)
+int _glfwPlatformCreateWindow(_GLFWwindow* window,
+ const _GLFWwndconfig* wndconfig,
+ const _GLFWfbconfig* fbconfig)
{
GLboolean recreateContext = GL_FALSE;
@@ -1083,7 +1083,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
// Properly kill the window / video display
//========================================================================
-void _glfwPlatformCloseWindow(_GLFWwindow* window)
+void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
destroyWindow(window);
diff --git a/src/window.c b/src/window.c
index fb69396d..8bc5fbeb 100644
--- a/src/window.c
+++ b/src/window.c
@@ -60,7 +60,7 @@ static void closeFlaggedWindows(void)
if (window->closeRequested)
{
_GLFWwindow* next = window->next;
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
window = next;
}
else
@@ -214,9 +214,9 @@ void _glfwInputWindowDamage(_GLFWwindow* window)
// Create the GLFW window and its associated context
//========================================================================
-GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
- int mode, const char* title,
- GLFWwindow share)
+GLFWAPI GLFWwindow glfwCreateWindow(int width, int height,
+ int mode, const char* title,
+ GLFWwindow share)
{
_GLFWfbconfig fbconfig;
_GLFWwndconfig wndconfig;
@@ -269,7 +269,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
if (mode != GLFW_WINDOWED && mode != GLFW_FULLSCREEN)
{
_glfwSetError(GLFW_INVALID_ENUM,
- "glfwOpenWindow: Invalid enum for 'mode' parameter");
+ "glfwCreateWindow: Invalid enum for 'mode' parameter");
return GL_FALSE;
}
@@ -295,7 +295,7 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
if (!window)
{
_glfwSetError(GLFW_OUT_OF_MEMORY,
- "glfwOpenWindow: Failed to allocate window structure");
+ "glfwCreateWindow: Failed to allocate window structure");
return NULL;
}
@@ -312,9 +312,9 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
window->systemKeys = GL_TRUE;
// Open the actual window and create its context
- if (!_glfwPlatformOpenWindow(window, &wndconfig, &fbconfig))
+ if (!_glfwPlatformCreateWindow(window, &wndconfig, &fbconfig))
{
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
return GL_FALSE;
}
@@ -325,14 +325,14 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
glfwMakeContextCurrent(window);
if (!_glfwRefreshContextParams())
{
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
return GL_FALSE;
}
// Verify the context against the requested parameters
if (!_glfwIsValidContext(&wndconfig))
{
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
return GL_FALSE;
}
@@ -351,10 +351,10 @@ GLFWAPI GLFWwindow glfwOpenWindow(int width, int height,
//========================================================================
-// Set hints for opening the window
+// Set hints for creating the window
//========================================================================
-GLFWAPI void glfwOpenWindowHint(int target, int hint)
+GLFWAPI void glfwWindowHint(int target, int hint)
{
if (!_glfwInitialized)
{
@@ -438,7 +438,7 @@ GLFWAPI void glfwOpenWindowHint(int target, int hint)
// Properly kill the window / video display
//========================================================================
-GLFWAPI void glfwCloseWindow(GLFWwindow handle)
+GLFWAPI void glfwDestroyWindow(GLFWwindow handle)
{
_GLFWwindow* window = (_GLFWwindow*) handle;
@@ -460,7 +460,7 @@ GLFWAPI void glfwCloseWindow(GLFWwindow handle)
if (window == _glfwLibrary.activeWindow)
_glfwLibrary.activeWindow = NULL;
- _glfwPlatformCloseWindow(window);
+ _glfwPlatformDestroyWindow(window);
// Unlink window from global linked list
{
diff --git a/src/x11_window.c b/src/x11_window.c
index 656c3735..cb0d5bcb 100644
--- a/src/x11_window.c
+++ b/src/x11_window.c
@@ -914,9 +914,9 @@ void _glfwProcessPendingEvents(void)
// the OpenGL rendering context is created
//========================================================================
-int _glfwPlatformOpenWindow(_GLFWwindow* window,
- const _GLFWwndconfig* wndconfig,
- const _GLFWfbconfig* fbconfig)
+int _glfwPlatformCreateWindow(_GLFWwindow* window,
+ const _GLFWwndconfig* wndconfig,
+ const _GLFWfbconfig* fbconfig)
{
window->refreshRate = wndconfig->refreshRate;
window->resizable = wndconfig->resizable;
@@ -973,7 +973,7 @@ int _glfwPlatformOpenWindow(_GLFWwindow* window,
// Properly kill the window/video display
//========================================================================
-void _glfwPlatformCloseWindow(_GLFWwindow* window)
+void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
if (window->mode == GLFW_FULLSCREEN)
leaveFullscreenMode(window);
diff --git a/tests/accuracy.c b/tests/accuracy.c
index 4a3a2b04..836bb18b 100644
--- a/tests/accuracy.c
+++ b/tests/accuracy.c
@@ -87,7 +87,7 @@ int main(void)
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(window_width, window_height, GLFW_WINDOWED, "", NULL);
+ window = glfwCreateWindow(window_width, window_height, GLFW_WINDOWED, "", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/clipboard.c b/tests/clipboard.c
index 05724f25..58e9bdd7 100644
--- a/tests/clipboard.c
+++ b/tests/clipboard.c
@@ -53,7 +53,7 @@ static void key_callback(GLFWwindow window, int key, int action)
switch (key)
{
case GLFW_KEY_ESCAPE:
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
break;
case GLFW_KEY_V:
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "Clipboard Test", NULL);
+ window = glfwCreateWindow(0, 0, GLFW_WINDOWED, "Clipboard Test", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/defaults.c b/tests/defaults.c
index 16c62723..289e2c60 100644
--- a/tests/defaults.c
+++ b/tests/defaults.c
@@ -74,7 +74,7 @@ int main(void)
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "Defaults", NULL);
+ window = glfwCreateWindow(0, 0, GLFW_WINDOWED, "Defaults", NULL);
if (!window)
{
glfwTerminate();
@@ -94,7 +94,7 @@ int main(void)
glfwGetWindowParam(window, parameters[i].param));
}
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
window = NULL;
glfwTerminate();
diff --git a/tests/events.c b/tests/events.c
index 7528e96f..85c6913f 100644
--- a/tests/events.c
+++ b/tests/events.c
@@ -367,7 +367,7 @@ int main(void)
glfwSetKeyCallback(key_callback);
glfwSetCharCallback(char_callback);
- window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "Event Linter", NULL);
+ window = glfwCreateWindow(0, 0, GLFW_WINDOWED, "Event Linter", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/fsaa.c b/tests/fsaa.c
index 4d22c4a6..0b11ac75 100644
--- a/tests/fsaa.c
+++ b/tests/fsaa.c
@@ -96,9 +96,9 @@ int main(int argc, char** argv)
glfwSetKeyCallback(key_callback);
glfwSetWindowSizeCallback(window_size_callback);
- glfwOpenWindowHint(GLFW_FSAA_SAMPLES, samples);
+ glfwWindowHint(GLFW_FSAA_SAMPLES, samples);
- window = glfwOpenWindow(800, 400, GLFW_WINDOWED, "Aliasing Detector", NULL);
+ window = glfwCreateWindow(800, 400, GLFW_WINDOWED, "Aliasing Detector", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/fsfocus.c b/tests/fsfocus.c
index b4bc7cb4..51075594 100644
--- a/tests/fsfocus.c
+++ b/tests/fsfocus.c
@@ -82,7 +82,7 @@ int main(void)
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(640, 480, GLFW_FULLSCREEN, "Fullscreen focus", NULL);
+ window = glfwCreateWindow(640, 480, GLFW_FULLSCREEN, "Fullscreen focus", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/gamma.c b/tests/gamma.c
index 22b6acd5..e9d487cd 100644
--- a/tests/gamma.c
+++ b/tests/gamma.c
@@ -60,7 +60,7 @@ static void key_callback(GLFWwindow window, int key, int action)
{
case GLFW_KEY_ESCAPE:
{
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
break;
}
@@ -130,7 +130,7 @@ int main(int argc, char** argv)
height = 0;
}
- window = glfwOpenWindow(width, height, mode, "Gamma Test", NULL);
+ window = glfwCreateWindow(width, height, mode, "Gamma Test", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/glfwinfo.c b/tests/glfwinfo.c
index bbbedce0..4990ff09 100644
--- a/tests/glfwinfo.c
+++ b/tests/glfwinfo.c
@@ -191,26 +191,26 @@ int main(int argc, char** argv)
if (major != 1 || minor != 0)
{
- glfwOpenWindowHint(GLFW_OPENGL_VERSION_MAJOR, major);
- glfwOpenWindowHint(GLFW_OPENGL_VERSION_MINOR, minor);
+ glfwWindowHint(GLFW_OPENGL_VERSION_MAJOR, major);
+ glfwWindowHint(GLFW_OPENGL_VERSION_MINOR, minor);
}
if (debug)
- glfwOpenWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
+ glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, GL_TRUE);
if (forward)
- glfwOpenWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
+ glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
if (profile != 0)
- glfwOpenWindowHint(GLFW_OPENGL_PROFILE, profile);
+ glfwWindowHint(GLFW_OPENGL_PROFILE, profile);
if (strategy)
- glfwOpenWindowHint(GLFW_OPENGL_ROBUSTNESS, strategy);
+ glfwWindowHint(GLFW_OPENGL_ROBUSTNESS, strategy);
// We assume here that we stand a better chance of success by leaving all
// possible details of pixel format selection to GLFW
- window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "Version", NULL);
+ window = glfwCreateWindow(0, 0, GLFW_WINDOWED, "Version", NULL);
if (!window)
exit(EXIT_FAILURE);
diff --git a/tests/iconify.c b/tests/iconify.c
index f9333f47..4deb45e7 100644
--- a/tests/iconify.c
+++ b/tests/iconify.c
@@ -55,7 +55,7 @@ static void key_callback(GLFWwindow window, int key, int action)
glfwIconifyWindow(window);
break;
case GLFW_KEY_ESCAPE:
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
break;
}
}
@@ -111,7 +111,7 @@ int main(int argc, char** argv)
height = 0;
}
- window = glfwOpenWindow(width, height, mode, "Iconify", NULL);
+ window = glfwCreateWindow(width, height, mode, "Iconify", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/joysticks.c b/tests/joysticks.c
index 3abd5fdd..b2375b83 100644
--- a/tests/joysticks.c
+++ b/tests/joysticks.c
@@ -186,7 +186,7 @@ int main(void)
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "Joystick Test", NULL);
+ window = glfwCreateWindow(0, 0, GLFW_WINDOWED, "Joystick Test", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/modes.c b/tests/modes.c
index 6d262ef3..9e72562a 100644
--- a/tests/modes.c
+++ b/tests/modes.c
@@ -85,7 +85,7 @@ static void key_callback(GLFWwindow dummy, int key, int action)
{
if (key == GLFW_KEY_ESCAPE)
{
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
window = NULL;
}
}
@@ -125,15 +125,15 @@ static void test_modes(void)
{
GLFWvidmode* mode = modes + i;
- glfwOpenWindowHint(GLFW_RED_BITS, mode->redBits);
- glfwOpenWindowHint(GLFW_GREEN_BITS, mode->greenBits);
- glfwOpenWindowHint(GLFW_BLUE_BITS, mode->blueBits);
+ glfwWindowHint(GLFW_RED_BITS, mode->redBits);
+ glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
+ glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
printf("Testing mode %u: %s", (unsigned int) i, format_mode(mode));
- window = glfwOpenWindow(mode->width, mode->height,
- GLFW_FULLSCREEN, "Video Mode Test",
- NULL);
+ window = glfwCreateWindow(mode->width, mode->height,
+ GLFW_FULLSCREEN, "Video Mode Test",
+ NULL);
if (!window)
{
printf("Failed to enter mode %u: %s\n",
@@ -182,7 +182,7 @@ static void test_modes(void)
printf("Closing window\n");
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
glfwPollEvents();
window = NULL;
}
diff --git a/tests/peter.c b/tests/peter.c
index e814caf6..e79e5805 100644
--- a/tests/peter.c
+++ b/tests/peter.c
@@ -78,7 +78,7 @@ static void key_callback(GLFWwindow window, int key, int action)
{
if (action == GLFW_PRESS)
{
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
open_window();
}
@@ -94,7 +94,7 @@ static void window_size_callback(GLFWwindow window, int width, int height)
static GLboolean open_window(void)
{
- window_handle = glfwOpenWindow(0, 0, GLFW_WINDOWED, "Peter Detector", NULL);
+ window_handle = glfwCreateWindow(0, 0, GLFW_WINDOWED, "Peter Detector", NULL);
if (!window_handle)
return GL_FALSE;
diff --git a/tests/reopen.c b/tests/reopen.c
index 2922cb84..1d692b80 100644
--- a/tests/reopen.c
+++ b/tests/reopen.c
@@ -92,7 +92,7 @@ static GLboolean open_window(int width, int height, int mode)
base = glfwGetTime();
- window_handle = glfwOpenWindow(width, height, mode, "Window Re-opener", NULL);
+ window_handle = glfwCreateWindow(width, height, mode, "Window Re-opener", NULL);
if (!window_handle)
{
fprintf(stderr, "Failed to open %s mode GLFW window: %s\n", get_mode_name(mode), glfwErrorString(glfwGetError()));
@@ -115,7 +115,7 @@ static void close_window(void)
{
double base = glfwGetTime();
- glfwCloseWindow(window_handle);
+ glfwDestroyWindow(window_handle);
window_handle = NULL;
printf("Closing window took %0.3f seconds\n", glfwGetTime() - base);
diff --git a/tests/sharing.c b/tests/sharing.c
index ed5ae024..5a2e028f 100644
--- a/tests/sharing.c
+++ b/tests/sharing.c
@@ -41,7 +41,7 @@ static GLFWwindow windows[2];
static void key_callback(GLFWwindow window, int key, int action)
{
if (action == GLFW_PRESS && key == GLFW_KEY_ESCAPE)
- glfwCloseWindow(window);
+ glfwDestroyWindow(window);
}
static int window_close_callback(GLFWwindow window)
@@ -64,7 +64,7 @@ static GLFWwindow open_window(const char* title, GLFWwindow share)
{
GLFWwindow window;
- window = glfwOpenWindow(WIDTH, HEIGHT, GLFW_WINDOWED, title, share);
+ window = glfwCreateWindow(WIDTH, HEIGHT, GLFW_WINDOWED, title, share);
if (!window)
return NULL;
diff --git a/tests/tearing.c b/tests/tearing.c
index de60f3c7..3ab131cd 100644
--- a/tests/tearing.c
+++ b/tests/tearing.c
@@ -72,7 +72,7 @@ int main(void)
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "", NULL);
+ window = glfwCreateWindow(0, 0, GLFW_WINDOWED, "", NULL);
if (!window)
{
glfwTerminate();
diff --git a/tests/title.c b/tests/title.c
index 310713c4..a66160b8 100644
--- a/tests/title.c
+++ b/tests/title.c
@@ -47,7 +47,7 @@ int main(void)
exit(EXIT_FAILURE);
}
- window = glfwOpenWindow(0, 0, GLFW_WINDOWED, "English 日本語 русский язык 官話", NULL);
+ window = glfwCreateWindow(0, 0, GLFW_WINDOWED, "English 日本語 русский язык 官話", NULL);
if (!window)
{
fprintf(stderr, "Failed to open GLFW window: %s\n", glfwErrorString(glfwGetError()));
diff --git a/tests/windows.c b/tests/windows.c
index 601db132..ac7500ad 100644
--- a/tests/windows.c
+++ b/tests/windows.c
@@ -64,7 +64,7 @@ int main(void)
for (i = 0; i < 4; i++)
{
- windows[i] = glfwOpenWindow(200, 200, GLFW_WINDOWED, titles[i], NULL);
+ windows[i] = glfwCreateWindow(200, 200, GLFW_WINDOWED, titles[i], NULL);
if (!windows[i])
{
fprintf(stderr, "Failed to open GLFW window: %s\n",