- function TEngine.init3D():Boolean;
- begin
- // shading mode
- glShadeModel(GL_FLAT);
- // background color
- glClearColor( 0.0, 0.5, 0.3, 0.0);
- glClearDepth( 1.0 );
- // depth testing
- glEnable(GL_DEPTH_TEST);
- glDepthFunc(GL_LEQUAL);
- // perspective calculator
- glHint( GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
- glViewport(0, 0, pSurface.w, pSurface.h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- // best perspective calculation
- gluPerspective(45, pSurface.w / pSurface.h, 0.1, 1000);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity;
- end;