6 #include "watersurface.h"
8 const int LATTICE_SIZE = 10;
9 const double LATTICE_UNIT = 1;
12 WaterSurfacePtr surface;
16 glMatrixMode(GL_PROJECTION); // Switch to the projection matrix so that we can manipulate how our scene is viewed
17 glLoadIdentity(); // Reset the projection matrix to the identity matrix so that we don't get any artifacts (cleaning up)
18 gluPerspective(50, (GLfloat)300 / (GLfloat)300, 0, 1000); // Set the Field of view angle (in degrees), the aspect ratio of our window, and the new and far planes
19 gluLookAt(0,-10,10, 0,0,0, 0,1,0);
26 glMatrixMode(GL_MODELVIEW);
29 glClear(GL_COLOR_BUFFER_BIT);
39 int main(int argc, char** argv)
41 std::srand(std::time(0));
43 surface = std::make_shared<WaterSurface>(LATTICE_SIZE, LATTICE_UNIT);
44 sea = std::make_shared<Sea>(surface);
46 glutInit(&argc, argv);
47 glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH);
48 glEnable(GL_DEPTH_TEST);
49 glutInitWindowSize(300, 300);
50 glutInitWindowPosition(100, 100);
51 glutCreateWindow("seamulator");
53 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
55 glutDisplayFunc(displayMe);