mirror of
https://github.com/gwm17/glfw.git
synced 2025-01-31 03:18:50 -05:00
Added error callback.
This commit is contained in:
parent
877c6337c3
commit
67a3f5dc8f
|
@ -88,6 +88,11 @@ static void size_callback(GLFWwindow window, int width, int height)
|
|||
glViewport(0, 0, width, height);
|
||||
}
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
fprintf(stderr, "Error: %s in %s\n", glfwErrorString(error), description);
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
int ch;
|
||||
|
@ -107,6 +112,8 @@ int main(int argc, char** argv)
|
|||
}
|
||||
}
|
||||
|
||||
glfwSetErrorCallback(error_callback);
|
||||
|
||||
if (!glfwInit())
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GLFW: %s\n", glfwErrorString(glfwGetError()));
|
||||
|
|
Loading…
Reference in New Issue
Block a user