mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 04:44:54 +00:00
Merge branch 'master' into utf8
This commit is contained in:
+1
-1
@@ -59,7 +59,7 @@ int main(void)
|
||||
{
|
||||
GLFWwindow window;
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ int main(void)
|
||||
int i, width, height;
|
||||
GLFWwindow window;
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ int main(void)
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW\n");
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+3
-9
@@ -298,10 +298,7 @@ static void key_callback(GLFWwindow window, int key, int action)
|
||||
case GLFW_KEY_R:
|
||||
{
|
||||
keyrepeat = !keyrepeat;
|
||||
if (keyrepeat)
|
||||
glfwEnable(window, GLFW_KEY_REPEAT);
|
||||
else
|
||||
glfwDisable(window, GLFW_KEY_REPEAT);
|
||||
glfwSetInputMode(window, GLFW_KEY_REPEAT, keyrepeat);
|
||||
|
||||
printf("(( key repeat %s ))\n", keyrepeat ? "enabled" : "disabled");
|
||||
break;
|
||||
@@ -310,10 +307,7 @@ static void key_callback(GLFWwindow window, int key, int action)
|
||||
case GLFW_KEY_S:
|
||||
{
|
||||
systemkeys = !systemkeys;
|
||||
if (systemkeys)
|
||||
glfwEnable(window, GLFW_SYSTEM_KEYS);
|
||||
else
|
||||
glfwDisable(window, GLFW_SYSTEM_KEYS);
|
||||
glfwSetInputMode(window, GLFW_SYSTEM_KEYS, systemkeys);
|
||||
|
||||
printf("(( system keys %s ))\n", systemkeys ? "enabled" : "disabled");
|
||||
break;
|
||||
@@ -336,7 +330,7 @@ int main(void)
|
||||
|
||||
setlocale(LC_ALL, "");
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+2
-2
@@ -75,7 +75,7 @@ int main(void)
|
||||
{
|
||||
GLFWwindow window;
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
@@ -91,7 +91,7 @@ int main(void)
|
||||
}
|
||||
|
||||
glfwSwapInterval(1);
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_NORMAL);
|
||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
|
||||
|
||||
glfwSetWindowFocusCallback(window_focus_callback);
|
||||
glfwSetKeyCallback(window_key_callback);
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@ int main(int argc, char** argv)
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ int main(int argc, char** argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -94,7 +94,7 @@ int main(void)
|
||||
double update;
|
||||
|
||||
/* Initialise GLFW */
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ int main(void)
|
||||
GLFWvidmode dtmode, modes[400];
|
||||
int modecount, i;
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+4
-7
@@ -35,7 +35,6 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static GLboolean cursor_captured = GL_FALSE;
|
||||
static GLFWwindow window_handle = NULL;
|
||||
static int cursor_x;
|
||||
static int cursor_y;
|
||||
@@ -44,18 +43,16 @@ static GLboolean open_window(void);
|
||||
|
||||
static void toggle_mouse_cursor(GLFWwindow window)
|
||||
{
|
||||
if (cursor_captured)
|
||||
if (glfwGetInputMode(window, GLFW_CURSOR_MODE) == GLFW_CURSOR_CAPTURED)
|
||||
{
|
||||
printf("Released cursor\n");
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_NORMAL);
|
||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Captured cursor\n");
|
||||
glfwSetCursorMode(window, GLFW_CURSOR_CAPTURED);
|
||||
glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_CAPTURED);
|
||||
}
|
||||
|
||||
cursor_captured = !cursor_captured;
|
||||
}
|
||||
|
||||
static void mouse_position_callback(GLFWwindow window, int x, int y)
|
||||
@@ -114,7 +111,7 @@ static GLboolean open_window(void)
|
||||
|
||||
int main(void)
|
||||
{
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ static GLboolean open_window(int width, int height, int mode)
|
||||
{
|
||||
double base;
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
return GL_FALSE;
|
||||
|
||||
+1
-1
@@ -117,7 +117,7 @@ int main(int argc, char** argv)
|
||||
GLuint texture;
|
||||
int x, y;
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ int main(void)
|
||||
float position;
|
||||
GLFWwindow window;
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
exit(EXIT_FAILURE);
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ int main(void)
|
||||
GLboolean running = GL_TRUE;
|
||||
GLFWwindow windows[4];
|
||||
|
||||
if (!glfwInit())
|
||||
if (!glfwInit(NULL))
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n",
|
||||
glfwErrorString(glfwGetError()));
|
||||
|
||||
Reference in New Issue
Block a user