... tbgl_PushMatrix tbgl_Translate 320, 100, 0 for j = 1 to 5 if j = actmenu then tbgl_Color 255,255,255 else tbgl_color 200,200,200 end if' tbgl_BindTexture %mnplate+j ' Sets texture #1 as actual' tbgl_BeginPoly %GL_QUADS' tbgl_TexCoord2D 0, 0' tbgl_Vertex -64, -20+j*46, 0 ' tbgl_TexCoord2D 1, 0 ' tbgl_Vertex 64, -20+j*46, 0' ' tbgl_TexCoord2D 1, 1 ' tbgl_Vertex 64, 20+j*46, 0' ' tbgl_TexCoord2D 0, 1 ' tbgl_Vertex -64, 20+j*46, 0' tbgl_EndPoly next tbgl_PopMatrix TBGL_ResetMatrix tbgl_drawframe...
'*-------------------------------------------------------* '* drawMenu * '*-------------------------------------------------------* sub RenderMenu() local pressed as long local jx as long pressed = %FALSE tbgl_GetAsyncKeyState(-1) ' Resets keys status before checking tbgl_UseAlphaTest 1 tbgl_AlphaFunc %tbGL_GREATER, 0.5 tbgl_UseDepth 0 ' No depth - it's useless for smokes, it will look better without it tbgl_Uselighting 0 ' No light tbgl_usetexture 1 ' Texturing on while IsWindow(hWnd) 'FPSCount = TBGL_GetFramerate 'help_CalcFramerate ' ******************************* ' * RENDERING THE SCENE * ' ******************************* tbgl_RenderMatrix2D tbgl_ClearFrame tbgl_BindTexture %mnPlate ' Sets texture #1 as actual tbgl_PushMatrix tbgl_backColor 0, 67,171 tbgl_Color 255,255,255 tbgl_Translate 320, 240, 0 ' We will map player texture to square polygon tbgl_BeginPoly %GL_QUADS tbgl_TexCoord2D 0, 0 tbgl_Vertex -128, -128, 0 tbgl_TexCoord2D 1, 0 tbgl_Vertex 128, -128, 0 tbgl_TexCoord2D 1, 1 tbgl_Vertex 128, 128, 0 tbgl_TexCoord2D 0, 1 tbgl_Vertex -128, 128, 0 tbgl_EndPoly tbgl_PopMatrix tbgl_PushMatrix tbgl_Translate 320, 100, 0 for j = 1 to 5 if j = actmenu then tbgl_Color 255,255,255 else tbgl_color 200,200,200 end if tbgl_BindTexture %mnplate+j ' Sets texture #1 as actual tbgl_BeginPoly %GL_QUADS tbgl_TexCoord2D 0, 0 tbgl_Vertex -64, -20+j*46 tbgl_TexCoord2D 1, 0 tbgl_Vertex 64, -20+j*46 tbgl_TexCoord2D 1, 1 tbgl_Vertex 64, 20+j*46 tbgl_TexCoord2D 0, 1 tbgl_Vertex -64, 20+j*46 tbgl_EndPoly next tbgl_PopMatrix tbgl_drawframe if tbgl_getwindowkeyonce(hWnd,%VK_DOWN) THEN actmenu = actmenu - 1 if tbgl_getwindowkeyonce(hWnd,%VK_UP) THEN actmenu = actmenu + 1 jx = tbdi_joyY(0) if Pressed = %TRUE and jx > -10 and jx < 10 then pressed = %FALSE end if if Pressed = %FALSE and jx < -10 then pressed = %TRUE actmenu = actmenu + 1 end if if Pressed = %FALSE and jx > 10 then pressed = %TRUE actmenu = actmenu - 1 end if If actmenu = 6 then actmenu = 1 If actmenu = 0 then actmenu = 5 if TBDI_JoyButton(0,2) <> 0 then exit while if GetAsyncKeyState(%VK_RETURN) THEN exit while wend end sub