My windows can't appear


#1

i tryed to make a window on centOS,but why none window appeared?

int main(void)
{
GLFWwindow* window = NULL;
glfwSetErrorCallback(error_callback);
if(!glfwInit())
{
exit(EXIT_FAILURE);
}

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);

window = glfwCreateWindow(640, 480, "Simple example", NULL, NULL);
if (!window)
{
    glfwTerminate();
    printf("%s\n","create failed!" );
    exit(EXIT_FAILURE);
}
// glfwShowWindow(window);
printf("%s\n","create success!" );
while(1);

}

[root@localhost glfw_test]# ./main
create success!

thanks for you reading.


#2

I suggest you try the simple code example on the glfw site, as this includes the correct event polling function call, along with buffer swapping.


#4

thank you very much :star_struck::star_struck::star_struck: