Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define GLEW_STATIC
- #include <glew.h>
- #include <freeglut.h>
- #include <iostream>
- using namespace std;
- void changeViewport(int w, int h){
- glViewport(0, 0, w, h);
- }
- void render(){
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
- glutSwapBuffers();
- }
- int main(int argc, char** argv){
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
- glutInitWindowSize(800, 600);
- glutCreateWindow("Hello, GL");
- glutReshapeFunc(changeViewport);
- glutDisplayFunc(render);
- cout << "test123" << endl;
- GLenum err = glewInit();
- if (GLEW_OK != err){
- std::cout << "There has been an error!" << std::endl;
- return 1;
- }
- glutMainLoop();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement