Renamed window creation/destruction functions.

Renamed glfwOpenWindow to glfwCreateWindow.
Renamed glfwCloseWindow to glfwDestroyWindow.
Renamed glfwOpenWindowHint to glfwWindowHint.
This commit is contained in:
Camilla Berglund
2012-08-06 17:56:41 +02:00
parent 13ff3eeca9
commit aff30d0baa
35 changed files with 109 additions and 109 deletions
+4 -4
View File
@@ -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];
+1 -1
View File
@@ -79,7 +79,7 @@ GLFWAPI void glfwTerminate(void)
// Close all remaining windows
while (_glfwLibrary.windowListHead)
glfwCloseWindow(_glfwLibrary.windowListHead);
glfwDestroyWindow(_glfwLibrary.windowListHead);
if (!_glfwPlatformTerminate())
return;
+4 -4
View File
@@ -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);
+14 -14
View File
@@ -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;
}
+1 -1
View File
@@ -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);
+6 -6
View File
@@ -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);
+14 -14
View File
@@ -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
{
+4 -4
View File
@@ -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);