X-Git-Url: http://git.treefish.org/~alex/seamulator.git/blobdiff_plain/3a3ad62faa958b07f2a91b4b21e6cfa92309ba80..986ab15c99a77bf9d2f827c2bad9c00dea9665d5:/seamulator.cpp?ds=inline diff --git a/seamulator.cpp b/seamulator.cpp index 8f6b5d8..572c154 100644 --- a/seamulator.cpp +++ b/seamulator.cpp @@ -13,9 +13,9 @@ WaterSurfacePtr surface; void setupView() { - glMatrixMode(GL_PROJECTION); // Switch to the projection matrix so that we can manipulate how our scene is viewed - glLoadIdentity(); // Reset the projection matrix to the identity matrix so that we don't get any artifacts (cleaning up) - 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 + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(50, (GLfloat)300 / (GLfloat)300, 0, 1000); gluLookAt(0,-10,10, 0,0,0, 0,1,0); } @@ -31,7 +31,7 @@ void displayMe(void) sea->update(); surface->draw(); - glFlush(); + glutSwapBuffers(); glutPostRedisplay(); } @@ -44,8 +44,7 @@ int main(int argc, char** argv) sea = std::make_shared(surface); glutInit(&argc, argv); - glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH); - glEnable(GL_DEPTH_TEST); + glutInitDisplayMode(GLUT_DOUBLE); glutInitWindowSize(300, 300); glutInitWindowPosition(100, 100); glutCreateWindow("seamulator");