mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-23 02:38:52 -05:00
Renamed window creation/destruction functions.
Renamed glfwOpenWindow to glfwCreateWindow. Renamed glfwCloseWindow to glfwDestroyWindow. Renamed glfwOpenWindowHint to glfwWindowHint.
This commit is contained in:
parent
13ff3eeca9
commit
aff30d0baa
|
@ -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" );
|
||||
|
|
|
@ -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" );
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -287,20 +287,20 @@ version of GLFW.</p>
|
|||
<li>Added <code>sharing</code> simple OpenGL object sharing test program</li>
|
||||
<li>Added <code>modes</code> video mode enumeration and setting test program</li>
|
||||
<li>Added <code>glfw3native.h</code> header and platform-specific functions for explicit access to native display, window and context handles</li>
|
||||
<li>Added a parameter to <code>glfwOpenWindow</code> for specifying a context the new window's context will share objects with</li>
|
||||
<li>Added initial window title parameter to <code>glfwOpenWindow</code></li>
|
||||
<li>Added <code>glfwSetGamma</code>, <code>glfwSetGammaRamp</code> and <code>glfwGetGammaRamp</code> functions and <code>GLFWgammaramp</code> type for monitor gamma ramp control</li>
|
||||
<li>Changed buffer bit depth parameters of <code>glfwOpenWindow</code> to window hints</li>
|
||||
<li>Changed <code>glfwOpenWindow</code> and <code>glfwSetWindowTitle</code> to use UTF-8 encoded strings</li>
|
||||
<li>Changed <code>glfwGetProcAddress</code> to return a (generic) function pointer</li>
|
||||
<li>Changed <code>glfwGetVideoModes</code> to return a dynamic, unlimited number of video modes</li>
|
||||
<li>Renamed <code>glfw.h</code> to <code>glfw3.h</code> to avoid conflicts with 2.x series</li>
|
||||
<li>Renamed <code>glfwOpenWindowHint</code> to <code>glfwWindowHint</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>GLFW_BUILD_DLL</code> to <code>_GLFW_BUILD_DLL</code></li>
|
||||
<li>Renamed <code>version</code> test to <code>glfwinfo</code></li>
|
||||
<li>Renamed <code>GLFW_NO_GLU</code> to <code>GLFW_INCLUDE_GLU</code> and made it disabled by default</li>
|
||||
<li>Renamed mouse position functions to cursor position equivalents</li>
|
||||
<li>Replaced <code>glfwOpenWindow</code> and <code>glfwCloseWindow</code> with <code>glfwCreateWindow</code> and <code>glfwDestroyWindow</code></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 mouse wheel interface with two-dimensional, floating point scrolling interface</li>
|
||||
|
|
|
@ -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];
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ GLFWAPI void glfwTerminate(void)
|
|||
|
||||
// Close all remaining windows
|
||||
while (_glfwLibrary.windowListHead)
|
||||
glfwCloseWindow(_glfwLibrary.windowListHead);
|
||||
glfwDestroyWindow(_glfwLibrary.windowListHead);
|
||||
|
||||
if (!_glfwPlatformTerminate())
|
||||
return;
|
||||
|
|
|
@ -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);
|
||||
|
|
28
src/opengl.c
28
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
28
src/window.c
28
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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue
Block a user