eng
competition

Text Practice Mode

GLFW get started

created Nov 24th 2015, 09:09 by BillyZaelaniMalik


0


Rating

87 words
15 completed
00:00
#include <GLFW/glfw3.h>
 
int main(void)
{
    GLFWwindow* window;
 
    /* Initialize the library */
    if (!glfwInit())
        return -1;
 
    /* Create a windowed mode window and its OpenGL context */
    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
    if (!window)
    {
        glfwTerminate();
        return -1;
    }
 
    /* Make the window's context current */
    glfwMakeContextCurrent(window);
 
    /* Loop until the user closes the window */
    while (!glfwWindowShouldClose(window))
    {
        /* Render here */
 
        /* Swap front and back buffers */
        glfwSwapBuffers(window);
 
        /* Poll for and process events */
        glfwPollEvents();
    }
 
    glfwTerminate();
    return 0;
}

saving score / loading statistics ...