annotate src/video/windows/SDL_windowsvideo.c @ 5284:96a22141cf86 tip

Changed output directory of Universal libSDL.a for iOS to respect build configurations. Template generator was updated to reflect these changes as well.
author Eric Wing <ewing . public |-at-| gmail . com>
date Sat, 12 Feb 2011 21:52:30 -0800
parents b530ef003506
children
rev   line source
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 /*
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
5267
b530ef003506 Happy 2011! :)
Sam Lantinga <slouken@libsdl.org>
parents: 5248
diff changeset
3 Copyright (C) 1997-2011 Sam Lantinga
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 Lesser General Public License for more details.
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 Sam Lantinga
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 slouken@libsdl.org
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22 #include "SDL_config.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 #include "SDL_main.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
25 #include "SDL_video.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
26 #include "SDL_mouse.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27 #include "../SDL_sysvideo.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28 #include "../SDL_pixels_c.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4919
diff changeset
30 #include "SDL_windowsvideo.h"
5178
9b2e99ebd099 Added the Windows framebuffer implementation.
Sam Lantinga <slouken@libsdl.org>
parents: 5157
diff changeset
31 #include "SDL_windowsframebuffer.h"
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4919
diff changeset
32 #include "SDL_windowsshape.h"
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
34 /* Initialization/Query functions */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
35 static int WIN_VideoInit(_THIS);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
36 static void WIN_VideoQuit(_THIS);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
37
2710
44e49d3fa6cf Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1952
diff changeset
38
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4919
diff changeset
39 /* Windows driver bootstrap functions */
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
40
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
41 static int
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
42 WIN_Available(void)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43 {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
44 return (1);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
45 }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
46
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
47 static void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
48 WIN_DeleteDevice(SDL_VideoDevice * device)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
49 {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
50 SDL_VideoData *data = (SDL_VideoData *) device->driverdata;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
51
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
52 SDL_UnregisterApp();
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
53 #ifdef _WIN32_WCE
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
54 if(data->hAygShell) {
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
55 SDL_UnloadObject(data->hAygShell);
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
56 }
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
57 #endif
4919
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
58 if (data->userDLL) {
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
59 SDL_UnloadObject(data->userDLL);
4919
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
60 }
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
61
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 SDL_free(device->driverdata);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
63 SDL_free(device);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
64 }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
65
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
66 static SDL_VideoDevice *
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67 WIN_CreateDevice(int devindex)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
69 SDL_VideoDevice *device;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70 SDL_VideoData *data;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
71
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
72 SDL_RegisterApp(NULL, 0, NULL);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
73
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 /* Initialize all variables that we clean on shutdown */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 if (device) {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
77 data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
4761
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
78 } else {
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
79 data = NULL;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80 }
4761
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
81 if (!data) {
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
82 SDL_OutOfMemory();
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
83 if (device) {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
84 SDL_free(device);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
85 }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
86 return NULL;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
87 }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
88 device->driverdata = data;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
89
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
90 #ifdef _WIN32_WCE
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
91 data->hAygShell = SDL_LoadObject("\\windows\\aygshell.dll");
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
92 if(0 == data->hAygShell)
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
93 data->hAygShell = SDL_LoadObject("aygshell.dll");
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
94 data->SHFullScreen = (0 != data->hAygShell ?
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
95 (PFNSHFullScreen) SDL_LoadFunction(data->hAygShell, "SHFullScreen") : 0);
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
96 data->CoordTransform = NULL;
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
97 #endif
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
98
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
99 data->userDLL = SDL_LoadObject("USER32.DLL");
4919
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
100 if (data->userDLL) {
5092
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
101 data->CloseTouchInputHandle = (BOOL (WINAPI *)( HTOUCHINPUT )) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle");
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
102 data->GetTouchInputInfo = (BOOL (WINAPI *)( HTOUCHINPUT, UINT, PTOUCHINPUT, int )) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo");
327f181542f1 Include windows.h in a single point in the source, so we can be consistent about the definition of UNICODE and have core utility functions for Windows that all modules can share.
Sam Lantinga <slouken@libsdl.org>
parents: 5090
diff changeset
103 data->RegisterTouchWindow = (BOOL (WINAPI *)( HWND, ULONG )) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow");
4919
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
104 }
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
105
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
106 /* Set the function pointers */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
107 device->VideoInit = WIN_VideoInit;
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
108 device->VideoQuit = WIN_VideoQuit;
3528
59ff7a2beb57 Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents: 3521
diff changeset
109 device->GetDisplayBounds = WIN_GetDisplayBounds;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
110 device->GetDisplayModes = WIN_GetDisplayModes;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
111 device->SetDisplayMode = WIN_SetDisplayMode;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
112 device->PumpEvents = WIN_PumpEvents;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
113
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
114 #undef CreateWindow
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
115 device->CreateWindow = WIN_CreateWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
116 device->CreateWindowFrom = WIN_CreateWindowFrom;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
117 device->SetWindowTitle = WIN_SetWindowTitle;
2970
94b634c56455 Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
118 device->SetWindowIcon = WIN_SetWindowIcon;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
119 device->SetWindowPosition = WIN_SetWindowPosition;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
120 device->SetWindowSize = WIN_SetWindowSize;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
121 device->ShowWindow = WIN_ShowWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
122 device->HideWindow = WIN_HideWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
123 device->RaiseWindow = WIN_RaiseWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
124 device->MaximizeWindow = WIN_MaximizeWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
125 device->MinimizeWindow = WIN_MinimizeWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
126 device->RestoreWindow = WIN_RestoreWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
127 device->SetWindowGrab = WIN_SetWindowGrab;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
128 device->DestroyWindow = WIN_DestroyWindow;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
129 device->GetWindowWMInfo = WIN_GetWindowWMInfo;
5178
9b2e99ebd099 Added the Windows framebuffer implementation.
Sam Lantinga <slouken@libsdl.org>
parents: 5157
diff changeset
130 device->CreateWindowFramebuffer = WIN_CreateWindowFramebuffer;
9b2e99ebd099 Added the Windows framebuffer implementation.
Sam Lantinga <slouken@libsdl.org>
parents: 5157
diff changeset
131 device->UpdateWindowFramebuffer = WIN_UpdateWindowFramebuffer;
9b2e99ebd099 Added the Windows framebuffer implementation.
Sam Lantinga <slouken@libsdl.org>
parents: 5157
diff changeset
132 device->DestroyWindowFramebuffer = WIN_DestroyWindowFramebuffer;
4788
0bfda420c936 Put in a couple of fixes that I realized hadn't gotten done when I wrote out the SCRUM stuff in TODO. Added SCRUM listings in TODO.
Eli Gottlieb <eligottlieb@gmail.com>
parents: 3697
diff changeset
133
0bfda420c936 Put in a couple of fixes that I realized hadn't gotten done when I wrote out the SCRUM stuff in TODO. Added SCRUM listings in TODO.
Eli Gottlieb <eligottlieb@gmail.com>
parents: 3697
diff changeset
134 device->shape_driver.CreateShaper = Win32_CreateShaper;
0bfda420c936 Put in a couple of fixes that I realized hadn't gotten done when I wrote out the SCRUM stuff in TODO. Added SCRUM listings in TODO.
Eli Gottlieb <eligottlieb@gmail.com>
parents: 3697
diff changeset
135 device->shape_driver.SetWindowShape = Win32_SetWindowShape;
0bfda420c936 Put in a couple of fixes that I realized hadn't gotten done when I wrote out the SCRUM stuff in TODO. Added SCRUM listings in TODO.
Eli Gottlieb <eligottlieb@gmail.com>
parents: 3697
diff changeset
136 device->shape_driver.ResizeWindowShape = Win32_ResizeWindowShape;
0bfda420c936 Put in a couple of fixes that I realized hadn't gotten done when I wrote out the SCRUM stuff in TODO. Added SCRUM listings in TODO.
Eli Gottlieb <eligottlieb@gmail.com>
parents: 3697
diff changeset
137
5090
455bc74f7034 Fixed bug #1100
Sam Lantinga <slouken@libsdl.org>
parents: 5088
diff changeset
138 #if SDL_VIDEO_OPENGL_WGL
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
139 device->GL_LoadLibrary = WIN_GL_LoadLibrary;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
140 device->GL_GetProcAddress = WIN_GL_GetProcAddress;
3057
089a77aebb7d Added test program for SDL_CreateWindowFrom()
Sam Lantinga <slouken@libsdl.org>
parents: 3013
diff changeset
141 device->GL_UnloadLibrary = WIN_GL_UnloadLibrary;
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
142 device->GL_CreateContext = WIN_GL_CreateContext;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
143 device->GL_MakeCurrent = WIN_GL_MakeCurrent;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
144 device->GL_SetSwapInterval = WIN_GL_SetSwapInterval;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
145 device->GL_GetSwapInterval = WIN_GL_GetSwapInterval;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
146 device->GL_SwapWindow = WIN_GL_SwapWindow;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
147 device->GL_DeleteContext = WIN_GL_DeleteContext;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
148 #endif
4761
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
149 device->StartTextInput = WIN_StartTextInput;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
150 device->StopTextInput = WIN_StopTextInput;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
151 device->SetTextInputRect = WIN_SetTextInputRect;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
152
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
153 device->SetClipboardText = WIN_SetClipboardText;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
154 device->GetClipboardText = WIN_GetClipboardText;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
155 device->HasClipboardText = WIN_HasClipboardText;
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
156
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
157 device->free = WIN_DeleteDevice;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
158
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
159 return device;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
160 }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
161
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4919
diff changeset
162 VideoBootStrap WINDOWS_bootstrap = {
5088
c2539ff054c8 Fixed compiling on Windows Mobile SDK 5.0 with Visual Studio 2008
Sam Lantinga <slouken@libsdl.org>
parents: 5062
diff changeset
163 "windows", "SDL Windows video driver", WIN_Available, WIN_CreateDevice
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
164 };
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
165
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
166 int
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
167 WIN_VideoInit(_THIS)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
168 {
3521
76f9b76ddf0f Don't add any renderers if you can't add any displays
Sam Lantinga <slouken@libsdl.org>
parents: 3168
diff changeset
169 if (WIN_InitModes(_this) < 0) {
76f9b76ddf0f Don't add any renderers if you can't add any displays
Sam Lantinga <slouken@libsdl.org>
parents: 3168
diff changeset
170 return -1;
76f9b76ddf0f Don't add any renderers if you can't add any displays
Sam Lantinga <slouken@libsdl.org>
parents: 3168
diff changeset
171 }
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
172
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
173 WIN_InitKeyboard(_this);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
174 WIN_InitMouse(_this);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
175
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
176 return 0;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
177 }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
178
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
179 void
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
180 WIN_VideoQuit(_THIS)
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
181 {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
182 WIN_QuitModes(_this);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
183 WIN_QuitKeyboard(_this);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
184 WIN_QuitMouse(_this);
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
185 }
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
186
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
187 /* vim: set ts=4 sw=4 expandtab: */