Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2015
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.64 KB | None | 0 0
  1. #include <GLFW/glfw3.h>
  2.  
  3. int main(void)
  4. {
  5.     if (!glfwInit())
  6.         return -1;
  7.  
  8.     GLFWwindow *window = glfwCreateWindow(800, 600, "OpenGL Resolution Test", NULL, NULL);
  9.     if (!window)
  10.     {
  11.         glfwTerminate();
  12.         return -1;
  13.     }
  14.  
  15.     glfwMakeContextCurrent(window);
  16.  
  17.     while (!glfwWindowShouldClose(window))
  18.     {
  19.         glClearColor(0.5f, 0.69f, 1.0f, 1.0f);
  20.         glClear(GL_COLOR_BUFFER_BIT);
  21.  
  22.         glfwPollEvents();
  23.         glfwSwapBuffers(window);
  24.     }
  25.  
  26.     glfwDestroyWindow(window);
  27.     glfwTerminate();
  28.     return 0;
  29. }
  30.  
  31.  
  32.  
  33. Compiled with:
  34. g++ main.cpp -o test `pkg-config --static --libs glfw3`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement