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
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -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();
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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();
+2 -2
View File
@@ -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();
+7 -7
View File
@@ -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);
+2 -2
View File
@@ -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();
+1 -1
View File
@@ -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();
+8 -8
View File
@@ -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;
}
+2 -2
View File
@@ -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;
+2 -2
View File
@@ -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);
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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()));
+1 -1
View File
@@ -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",