-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (43 loc) · 950 Bytes
/
main.cpp
File metadata and controls
52 lines (43 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef GLEW_STATIC
#define GLEW_STATIC
#endif
#ifndef FREEGLUT_STATIC
#define FREEGLUT_STATIC
#endif
#include <gl/glew.h>
#include <gl/gl.h>
#include <GL/glut.h>
#include <iostream>
#include "ExampleApplication.h"
ExampleApplication app;
void onResizeWindow( int w, int h )
{
app.onResizeWindow( w, h );
}
void onKeyDown( unsigned char k, int mouseX, int mouseY )
{
app.onKeyDown( k, mouseX, mouseY );
}
void onRenderScene()
{
app.render();
}
int main( int argc, char **argv )
{
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH );
glutInitWindowSize( 800, 600 );
glutCreateWindow( "Example GLUT Application" );
glutReshapeFunc( onResizeWindow );
glutDisplayFunc( onRenderScene );
glutKeyboardFunc( onKeyDown );
GLenum err = glewInit();
if( GLEW_OK != err )
{
std::cerr << "GLEW Error: " << glewGetErrorString( err ) << std::endl;
return 1;
}
app.setup();
glutMainLoop();
return 0;
}