changeset 7866 | 58d10edc5d21 |
parent 7754 | e81dc9bef8b8 |
child 8022 | 10b3b93c1f56 |
child 8026 | 4a4f21070479 |
child 8027 | e5ba3dd12531 |
7865:2edc88e9fcd6 | 7866:58d10edc5d21 |
---|---|
51 {$IFDEF USE_VIDEO_RECORDING} |
51 {$IFDEF USE_VIDEO_RECORDING} |
52 procedure InitOffscreenOpenGL; |
52 procedure InitOffscreenOpenGL; |
53 {$ENDIF} |
53 {$ENDIF} |
54 |
54 |
55 procedure WarpMouse(x, y: Word); inline; |
55 procedure WarpMouse(x, y: Word); inline; |
56 procedure SwapBuffers; inline; |
56 procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF}; |
57 |
57 |
58 implementation |
58 implementation |
59 uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands, |
59 uses uMisc, uConsole, uMobile, uVariables, uUtils, uTextures, uRender, uRenderUtils, uCommands, |
60 uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF} |
60 uDebug{$IFDEF USE_CONTEXT_RESTORE}, uWorld{$ENDIF} |
61 {$IF NOT DEFINED(SDL13) AND DEFINED(USE_VIDEO_RECORDING)}, glut {$ENDIF}; |
61 {$IF NOT DEFINED(SDL13) AND DEFINED(USE_VIDEO_RECORDING)}, glut {$ENDIF}; |
1113 PrgName:= 'hwengine'; |
1113 PrgName:= 'hwengine'; |
1114 glutInit(@ArgCount, @PrgName); |
1114 glutInit(@ArgCount, @PrgName); |
1115 glutInitWindowSize(cScreenWidth, cScreenHeight); |
1115 glutInitWindowSize(cScreenWidth, cScreenHeight); |
1116 glutCreateWindow('hedgewars (you don''t see this)'); // we don't need a window, but if this function is not called then OpenGL will not be initialized |
1116 glutCreateWindow('hedgewars (you don''t see this)'); // we don't need a window, but if this function is not called then OpenGL will not be initialized |
1117 glutHideWindow(); |
1117 glutHideWindow(); |
1118 glutDisplayFunc(@SwapBuffers); // we don't need a callback, but it's required for GLUT3 |
|
1118 SetupOpenGL(); |
1119 SetupOpenGL(); |
1119 end; |
1120 end; |
1120 {$ENDIF} // SDL13 |
1121 {$ENDIF} // SDL13 |
1121 {$ENDIF} // USE_VIDEO_RECORDING |
1122 {$ENDIF} // USE_VIDEO_RECORDING |
1122 |
1123 |
1294 {$ELSE} |
1295 {$ELSE} |
1295 x:= x; y:= y; // avoid hints |
1296 x:= x; y:= y; // avoid hints |
1296 {$ENDIF} |
1297 {$ENDIF} |
1297 end; |
1298 end; |
1298 |
1299 |
1299 procedure SwapBuffers; inline; |
1300 procedure SwapBuffers; {$IFDEF USE_VIDEO_RECORDING}cdecl{$ELSE}inline{$ENDIF}; |
1300 begin |
1301 begin |
1301 if GameType = gmtRecord then |
1302 if GameType = gmtRecord then |
1302 exit; |
1303 exit; |
1303 {$IFDEF SDL13} |
1304 {$IFDEF SDL13} |
1304 SDL_GL_SwapWindow(SDLwindow); |
1305 SDL_GL_SwapWindow(SDLwindow); |