Changeset 1208 for trunk/src/platform
- Timestamp:
- Apr 10, 2012, 3:12:52 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/platform/sdl/sdlapp.cpp
r1106 r1208 15 15 #if defined USE_SDL 16 16 # include <SDL.h> 17 # if defined USE_D3D9 18 # include <d3d9.h> 19 # include <SDL_syswm.h> 20 # endif 17 21 #endif 18 22 … … 21 25 #include "platform/sdl/sdlapp.h" 22 26 #include "platform/sdl/sdlinput.h" 27 28 #if defined USE_D3D9 29 HWND g_hwnd = NULL; 30 #endif 23 31 24 32 namespace lol … … 52 60 } 53 61 62 # if defined USE_D3D9 63 SDL_Surface *video = SDL_SetVideoMode(res.x, res.y, 16, 0); 64 SDL_SysWMinfo wminfo; 65 SDL_VERSION(&wminfo.version); 66 SDL_GetWMInfo(&wminfo); 67 g_hwnd = wminfo.window; 68 # else 54 69 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); 55 70 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); 56 71 SDL_Surface *video = SDL_SetVideoMode(res.x, res.y, 0, SDL_OPENGL); 72 # endif 57 73 if (!video) 58 74 { 59 Log::Error("cannot create OpenGL screen: %s\n", SDL_GetError());75 Log::Error("cannot create rendering window: %s\n", SDL_GetError()); 60 76 SDL_Quit(); 61 77 exit(EXIT_FAILURE); … … 85 101 while (!Ticker::Finished()) 86 102 { 103 #if defined USE_SDL && defined USE_D3D9 104 extern IDirect3DDevice9 *g_d3ddevice; 105 g_d3ddevice->BeginScene(); 106 #endif 87 107 /* Tick the renderer, show the frame and clamp to desired framerate. */ 88 108 Ticker::TickDraw(); 89 109 #if defined USE_SDL 110 # if defined USE_D3D9 111 g_d3ddevice->EndScene(); 112 g_d3ddevice->Present(NULL, NULL, NULL, NULL); 113 # else 90 114 SDL_GL_SwapBuffers(); 115 # endif 91 116 #endif 92 117 }
Note: See TracChangeset
for help on using the changeset viewer.