Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int checkGlew()
- {
- GLenum err = glewInit();
- if (err != GLEW_OK) {
- std::cout << "OpenGL/GLEW error while initializing!" << std::endl;
- std::cout << glewGetErrorString(err) << std::endl;
- std::cout << (char*)glGetString( GL_VERSION ) << std::endl;
- std::getchar();
- return 1;
- }
- if (!glewIsSupported("GL_VERSION_2_0")) {
- std::cout << "OpenGL 2.0 found, shaders not supported" << std::endl;
- std::getchar();
- return 1;
- }
- }
- int main( int argc, char **argv )
- {
- glutInit (&argc, argv);
- glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
- glutInitWindowPosition (100, 100);
- glutInitWindowSize (windowWidth, windowHeight);
- glutCreateWindow ("Deferred Shading");
- int err = checkGlew();
- if (err == 1)
- return 0;
- glShadeModel (GL_FLAT); // probably want GL_SMOOTH here unless you like your renders looking like hairy mens asses
- init();
- glutDisplayFunc (display);
- glutReshapeFunc (windowReshape);
- glutSpecialFunc (HandleSpecialKeyboard);
- glutMainLoop ();
- }
Add Comment
Please, Sign In to add comment