Advertisement
Guest User

Untitled

a guest
Sep 15th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #define GLEW_STATIC
  2.  
  3. #include <glew.h>
  4. #include <freeglut.h>
  5. #include <iostream>
  6.  
  7. using namespace std;
  8.  
  9. void changeViewport(int w, int h){
  10.         glViewport(0, 0, w, h);
  11. }
  12.  
  13. void render(){
  14.         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  15.         glutSwapBuffers();
  16. }
  17.  
  18. int main(int argc, char** argv){
  19.         glutInit(&argc, argv);
  20.  
  21.         glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
  22.  
  23.         glutInitWindowSize(800, 600);
  24.  
  25.         glutCreateWindow("Hello, GL");
  26.  
  27.         glutReshapeFunc(changeViewport);
  28.         glutDisplayFunc(render);
  29.  
  30.         cout << "test123" << endl;
  31.  
  32.         GLenum err = glewInit();
  33.         if (GLEW_OK != err){
  34.                 std::cout << "There has been an error!" << std::endl;
  35.                 return 1;
  36.         }
  37.  
  38.         glutMainLoop();
  39.         return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement