6 #include "watersurface.h"
8 const int LATTICE_SIZE = 10;
9 const double LATTICE_UNIT = 1;
12 WaterSurfacePtr surface;
16 glMatrixMode(GL_MODELVIEW);
19 glClear(GL_COLOR_BUFFER_BIT);
29 void glReshapeFunc(int width, int height)
31 glMatrixMode(GL_PROJECTION);
33 gluPerspective(50.0, ((float)width/(float)height), 0, 1000.0);
34 glViewport(0, 0, width, height);
35 gluLookAt(0,-10,10, 0,0,0, 0,1,0);
38 int main(int argc, char** argv)
40 std::srand(std::time(0));
42 surface = std::make_shared<WaterSurface>(LATTICE_SIZE, LATTICE_UNIT);
43 sea = std::make_shared<Sea>(surface);
45 glutInit(&argc, argv);
46 glutInitDisplayMode(GLUT_DOUBLE);
47 glutInitWindowSize(300, 300);
48 glutInitWindowPosition(100, 100);
49 glutCreateWindow("seamulator");
51 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
53 glutDisplayFunc(glDisplayFunc);
54 glutReshapeFunc(glReshapeFunc);