Advertisement
Guest User

mpma_opengl

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