Examples: Renamed glfw error callback so it's more clear what it is.

This commit is contained in:
omar 2018-03-02 19:20:58 +01:00
parent fc80f2b41a
commit 5b282bdd48
3 changed files with 9 additions and 9 deletions

View File

@ -12,15 +12,15 @@
#include <stdio.h> #include <stdio.h>
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
static void error_callback(int error, const char* description) static void glfw_error_callback(int error, const char* description)
{ {
fprintf(stderr, "Error %d: %s\n", error, description); fprintf(stderr, "Glfw Error %d: %s\n", error, description);
} }
int main(int, char**) int main(int, char**)
{ {
// Setup window // Setup window
glfwSetErrorCallback(error_callback); glfwSetErrorCallback(glfw_error_callback);
if (!glfwInit()) if (!glfwInit())
return 1; return 1;
GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL2 example", NULL, NULL); GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL2 example", NULL, NULL);

View File

@ -10,15 +10,15 @@
#include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you. #include <GL/gl3w.h> // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
static void error_callback(int error, const char* description) static void glfw_error_callback(int error, const char* description)
{ {
fprintf(stderr, "Error %d: %s\n", error, description); fprintf(stderr, "Glfw Error %d: %s\n", error, description);
} }
int main(int, char**) int main(int, char**)
{ {
// Setup window // Setup window
glfwSetErrorCallback(error_callback); glfwSetErrorCallback(glfw_error_callback);
if (!glfwInit()) if (!glfwInit())
return 1; return 1;
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);

View File

@ -530,15 +530,15 @@ static void frame_present()
g_FrameIndex = (g_FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES; g_FrameIndex = (g_FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES;
} }
static void error_callback(int error, const char* description) static void glfw_error_callback(int error, const char* description)
{ {
fprintf(stderr, "Error %d: %s\n", error, description); fprintf(stderr, "Glfw Error %d: %s\n", error, description);
} }
int main(int, char**) int main(int, char**)
{ {
// Setup window // Setup window
glfwSetErrorCallback(error_callback); glfwSetErrorCallback(glfw_error_callback);
if (!glfwInit()) if (!glfwInit())
return 1; return 1;