Mercurial > sdl-ios-xcode
annotate src/video/win32/SDL_win32video.c @ 3770:81b649bad6d2 gsoc2008_manymouse
Implementation finished
author | Szymon Wilczek <kazeuser@gmail.com> |
---|---|
date | Thu, 31 Jul 2008 14:41:48 +0000 |
parents | 1b87a8beab9d |
children | 8cc36a399a12 |
rev | line source |
---|---|
3770
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
1 /* |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
2 SDL - Simple DirectMedia Layer |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
3 Copyright (C) 1997-2006 Sam Lantinga |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
4 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
5 This library is free software; you can redistribute it and/or |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
7 License as published by the Free Software Foundation; either |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
9 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
10 This library is distributed in the hope that it will be useful, |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
13 Lesser General Public License for more details. |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
14 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
18 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
19 Sam Lantinga |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
20 slouken@libsdl.org |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
21 */ |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
22 #include "SDL_config.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
23 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
24 #include "SDL_main.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
25 #include "SDL_video.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
26 #include "SDL_mouse.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
27 #include "../SDL_sysvideo.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
28 #include "../SDL_pixels_c.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
29 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
30 #include "SDL_win32video.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
31 #include "SDL_d3drender.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
32 #include "SDL_gdirender.h" |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
33 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
34 #include <wintab.h> |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
35 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
36 /* Initialization/Query functions */ |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
37 static int WIN_VideoInit(_THIS); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
38 static void WIN_VideoQuit(_THIS); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
39 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
40 int total_mice =0; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
41 HANDLE* mice = NULL; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
42 HCTX* g_hCtx = NULL; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
43 int tablet=-1; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
44 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
45 /* WIN32 driver bootstrap functions */ |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
46 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
47 static int |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
48 WIN_Available(void) |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
49 { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
50 return (1); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
51 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
52 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
53 static void |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
54 WIN_DeleteDevice(SDL_VideoDevice * device) |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
55 { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
56 SDL_VideoData *data = (SDL_VideoData *) device->driverdata; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
57 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
58 SDL_UnregisterApp(); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
59 #if SDL_VIDEO_RENDER_D3D |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
60 if (data->d3d) { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
61 IDirect3D9_Release(data->d3d); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
62 FreeLibrary(data->d3dDLL); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
63 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
64 #endif |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
65 SDL_free(device->driverdata); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
66 SDL_free(device); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
67 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
68 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
69 static SDL_VideoDevice * |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
70 WIN_CreateDevice(int devindex) |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
71 { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
72 SDL_VideoDevice *device; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
73 SDL_VideoData *data; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
74 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
75 SDL_RegisterApp(NULL, 0, NULL); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
76 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
77 /* Initialize all variables that we clean on shutdown */ |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
78 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice)); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
79 if (device) { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
80 data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData)); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
81 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
82 if (!device || !data) { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
83 SDL_OutOfMemory(); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
84 if (device) { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
85 SDL_free(device); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
86 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
87 return NULL; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
88 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
89 device->driverdata = data; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
90 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
91 #if SDL_VIDEO_RENDER_D3D |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
92 data->d3dDLL = LoadLibrary(TEXT("D3D9.DLL")); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
93 if (data->d3dDLL) { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
94 IDirect3D9 *(WINAPI * D3DCreate) (UINT SDKVersion); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
95 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
96 D3DCreate = |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
97 (IDirect3D9 * (WINAPI *) (UINT)) GetProcAddress(data->d3dDLL, |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
98 "Direct3DCreate9"); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
99 if (D3DCreate) { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
100 data->d3d = D3DCreate(D3D_SDK_VERSION); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
101 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
102 if (!data->d3d) { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
103 FreeLibrary(data->d3dDLL); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
104 data->d3dDLL = NULL; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
105 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
106 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
107 #endif /* SDL_VIDEO_RENDER_D3D */ |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
108 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
109 /* Set the function pointers */ |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
110 device->VideoInit = WIN_VideoInit; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
111 device->VideoQuit = WIN_VideoQuit; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
112 device->GetDisplayModes = WIN_GetDisplayModes; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
113 device->SetDisplayMode = WIN_SetDisplayMode; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
114 device->SetDisplayGammaRamp = WIN_SetDisplayGammaRamp; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
115 device->GetDisplayGammaRamp = WIN_GetDisplayGammaRamp; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
116 device->PumpEvents = WIN_PumpEvents; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
117 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
118 #undef CreateWindow |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
119 device->CreateWindow = WIN_CreateWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
120 device->CreateWindowFrom = WIN_CreateWindowFrom; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
121 device->SetWindowTitle = WIN_SetWindowTitle; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
122 device->SetWindowPosition = WIN_SetWindowPosition; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
123 device->SetWindowSize = WIN_SetWindowSize; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
124 device->ShowWindow = WIN_ShowWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
125 device->HideWindow = WIN_HideWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
126 device->RaiseWindow = WIN_RaiseWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
127 device->MaximizeWindow = WIN_MaximizeWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
128 device->MinimizeWindow = WIN_MinimizeWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
129 device->RestoreWindow = WIN_RestoreWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
130 device->SetWindowGrab = WIN_SetWindowGrab; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
131 device->DestroyWindow = WIN_DestroyWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
132 device->GetWindowWMInfo = WIN_GetWindowWMInfo; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
133 #ifdef SDL_VIDEO_OPENGL_WGL |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
134 device->GL_LoadLibrary = WIN_GL_LoadLibrary; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
135 device->GL_GetProcAddress = WIN_GL_GetProcAddress; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
136 device->GL_CreateContext = WIN_GL_CreateContext; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
137 device->GL_MakeCurrent = WIN_GL_MakeCurrent; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
138 device->GL_SetSwapInterval = WIN_GL_SetSwapInterval; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
139 device->GL_GetSwapInterval = WIN_GL_GetSwapInterval; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
140 device->GL_SwapWindow = WIN_GL_SwapWindow; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
141 device->GL_DeleteContext = WIN_GL_DeleteContext; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
142 #endif |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
143 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
144 device->free = WIN_DeleteDevice; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
145 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
146 return device; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
147 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
148 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
149 VideoBootStrap WIN32_bootstrap = { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
150 "win32", "SDL Win32/64 video driver", |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
151 WIN_Available, WIN_CreateDevice |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
152 }; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
153 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
154 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
155 int |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
156 WIN_VideoInit(_THIS) |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
157 { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
158 WIN_InitModes(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
159 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
160 #if SDL_VIDEO_RENDER_D3D |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
161 D3D_AddRenderDriver(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
162 #endif |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
163 #if SDL_VIDEO_RENDER_GDI |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
164 GDI_AddRenderDriver(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
165 #endif |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
166 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
167 g_hCtx = SDL_malloc(sizeof(HCTX)); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
168 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
169 WIN_InitKeyboard(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
170 WIN_InitMouse(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
171 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
172 return 0; |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
173 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
174 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
175 void |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
176 WIN_VideoQuit(_THIS) |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
177 { |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
178 WIN_QuitModes(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
179 WIN_QuitKeyboard(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
180 WIN_QuitMouse(_this); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
181 SDL_free(g_hCtx); |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
182 } |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
183 |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
184 /* vim: set ts=4 sw=4 expandtab: */ |
81b649bad6d2
Implementation finished
Szymon Wilczek <kazeuser@gmail.com>
parents:
3768
diff
changeset
|
185 |