- procedure Tform1.Render;
- begin
- CheckForGameErrors;
- steps := steps + 1;
- glClear(GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT);
- //Bewegung der Maus Feststellen wenn Steuerung mit der Maus aktiviert wurde
- if ViewByMouse = true then
- ViewByMousep;
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- glOrtho(0, Optionen.Aufloesung[1], Optionen.Aufloesung[2], 0, 5, 20);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity;
- //Draw 2D HUD
- GameHUDText;
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity;
- gluPerspective(45.0, ClientWidth/ClientHeight, NearClipping, FarClipping);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity;
- glrotatef(PlayerPos.Rot,0,1,0);
- gltranslatef(PlayerPos.X,Playerpos.Y,Playerpos.Z);
- //Draw 3D Szene
- GameSzene3D;
- SwapBuffers(DC);
- end;