lList (PauseToGame);
end;// Start
if Selected_Menu_item = 'Car' then// Натиснуто клавіша Car
begin// Car
if RemoveMeny <= -0.5 then RemoveMeny: = -0.5 else RemoveMeny: = RemoveMeny-0.018;
glCallList (Background);
glPushMatrix;
glTranslatef (RemoveMeny, 0.0,0.0);
glCallList (StringMeny);
glPopMatrix;
if RemoveMeny <= -0.5 then
begin
// Меню
glPushMatrix;
glTranslatef (0.5,0.2,0.0),
glCallList (SubMenuInCar),
glPopMatrix;
DeleyButtonInCarMeny;
// Вибирається машина
case CarMenuItem of
1: begin
// ShotWarKiller
glPushMatrix;
glTranslatef (0.5,0.12,0.0);
glCallList (ShotWarKiller);
glPopMatrix;
ChooseCar: = 'ShotWarKiller';
CarXPogresh: = XPogreshWarKiller;
CarYPogresh: = YPogreshWarKiller;
end;
2: begin
// ShotFlash
glPushMatrix;
glTranslatef (0.5,0.12,0.0);
glCallList (ShotFlash);
glPopMatrix;
ChooseCar: = 'ShotFlash';
CarXPogresh: = XPogreshFlash;
CarYPogresh: = YPogreshFlash;
end;
3: begin
// ShotGembic
glPushMatrix;
glTranslatef (0.5,0.12,0.0);
glCallList (ShotGembic);
glPopMatrix;
ChooseCar: = 'ShotGembic';
CarXPogresh: = XPogreshFlash;
CarYPogresh: = YPogreshFlash;
end;
4: begin
// ShotGlass
glPushMatrix;
glTranslatef (0.5,0.12,0.0);
glCallList (ShotGlass);
glPopMatrix;
ChooseCar: = 'ShotGlass';
CarXPogresh: = XPogreshFlash;
CarYPogresh: = YPogreshFlash;
end;
end ;//Case
end ;//RemoveMeny
end;// Car
if Selected_Menu_item = 'Actors' then// Натиснуто клавіша Actors
begin
glCallList (Actor),
end;
if Selected_Menu_item = 'Exit' then// Натиснуто клавіша Exit
begin
end;
SwapBuffers (DC);
EndPaint (DC, ps);
{if Selected_Menu_item = 'Start'then begin
Canvas.Brush.Color: = clWhite;
Canvas.TextOut (500,40, 'Бензин: '+ FloatToStrF (CountFuel, ffNumber, 6,3) +' л ');
Canvas.TextOut (500,55, 'Нітро: '+ FloatToStrF (CountNitro, ffNumber, 6,3) +' кг/см ');
Canvas.TextOut (500,70, 'К.метри: '+ FloatToStrF (CountKM, ffNumber, 6,3) +' км ');
end;}
//
Caption: = StatisticCaption;
// Підтримка апаратного прискорювача і версія OpenGL клавіша 'a'
if PressedKey [65] = true then
Caption: = 'OpenGL:' +
StrPas (glGetString (GL_VERSION)) +
'' +
StrPas (glGetString (GL_VENDOR)) +
'' +
StrPas (glGetString (GL_RENDERER));
if PressedKey [70] = true then// Показувати Fps - клавіша 'f'
begin
newCount: = GetTickCount;
Inc (frameCount);
If abs (newCount - lastCount)> 1000 then
begin
StatisticCaption: = 'FPS:' + FloatToStr (frameCount);
lastCount: = newCount;
frameCount: = 0;
end;
end;
if PressedKey [75] = true then
StatisticCaption: = 'X =' + FloatToStrF (xpos, ffNumber, 4,3) +
'' + 'Y =' + FloatToStrF (ypos, ffNumber, 4,3);
if (PressedKey [70] = false) and
(PressedKey [75] = false) and
(PressedKey [65] = false) then StatisticCaption: = 'SpeedLine';
end;
procedure TSpeedGL.FormDestroy (Sender: TObject);
begin
// glDeleteLists (1,1);
timeKillEvent (uTimerID);
wglMakeCurrent (0, 0);
wglDeleteContext (hrc);
ReleaseDC (Handle, DC);
end;
procedure TSpeedGL.FormMouseMove (Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
//////////////////////////////////////////////
xpos: = 2 * X/ClientWidth-1;
ypos: = 2 * (ClientHeight-Y)/ClientHeight-1;
//////////////////////////////////////////////
if Selected_Menu_item ='' then begin// Selected_Menu_item
if (Xpos> -0.3) and (ypos> 0.4) and
(Xpos <0.3) and (ypos> 0.4) and
(Xpos <0.3) and (ypos <0.6) and
(Xpos> -0.3) and (ypos <0.6) then begin
if Menu_item <> 1 then
PlaySound ('Sound Select_MainMenu.wav', 0, SND_ASYNC);
Menu_item: = 1;
end;
if (Xpos> -0.3) and (ypos> 0.15) and
(Xpos <0.3) and (ypos> 0.15) and
(Xpos <0.3) and (ypos <0.35) and
(Xpos> -0.3) and (ypos <0.35) then begin