annotate src/video/windows/SDL_windowsvideo.c @ 5157:fb424691cfc7

Moved the rendering code out to a separate directory in the hope that it can someday be completely decoupled from the rest of the library and be expanded to an awesome 2D on 3D library.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 02 Feb 2011 14:34:54 -0800
parents 57851a238c8f
children 9b2e99ebd099
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
3697
f7b03b6838cb Fixed bug #926
Sam Lantinga <slouken@libsdl.org>
parents: 3528
diff changeset
3 Copyright (C) 1997-2010 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"
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4919
diff changeset
31 #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
32
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 /* 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
34 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
35 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
36
2710
44e49d3fa6cf Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents: 1952
diff changeset
37
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4919
diff changeset
38 /* 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
39
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 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
41 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
42 {
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 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
44 }
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 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
47 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
48 {
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 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
50
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 SDL_UnregisterApp();
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
52 #ifdef _WIN32_WCE
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
53 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
54 SDL_UnloadObject(data->hAygShell);
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
55 }
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
56 #endif
4919
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
57 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
58 SDL_UnloadObject(data->userDLL);
4919
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
59 }
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
60
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
61 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
62 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
63 }
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 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
66 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
67 {
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 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
69 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
70
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 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
72
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 /* 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
74 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
75 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
76 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
77 } else {
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
78 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
79 }
4761
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
80 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
81 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
82 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
83 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
84 }
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 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
86 }
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 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
88
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
89 #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
90 data->hAygShell = SDL_LoadObject("\\windows\\aygshell.dll");
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
91 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
92 data->hAygShell = SDL_LoadObject("aygshell.dll");
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
93 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
94 (PFNSHFullScreen) SDL_LoadFunction(data->hAygShell, "SHFullScreen") : 0);
4569
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
95 data->CoordTransform = NULL;
e1664f94f026 Andrey A.
Sam Lantinga <slouken@libsdl.org>
parents: 4504
diff changeset
96 #endif
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
97
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
98 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
99 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
100 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
101 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
102 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
103 }
716b2cbf4c9e First pass at Windows multi-touch gesture support
Sam Lantinga <slouken@libsdl.org>
parents: 4862
diff changeset
104
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
105 /* 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
106 device->VideoInit = WIN_VideoInit;
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
107 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
108 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
109 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
110 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
111 device->SetDisplayGammaRamp = WIN_SetDisplayGammaRamp;
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->GetDisplayGammaRamp = WIN_GetDisplayGammaRamp;
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 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
114
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 #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
116 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
117 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
118 device->SetWindowTitle = WIN_SetWindowTitle;
2970
94b634c56455 Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents: 2859
diff changeset
119 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
120 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
121 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
122 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
123 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
124 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
125 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
126 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
127 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
128 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
129 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
130 device->GetWindowWMInfo = WIN_GetWindowWMInfo;
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
131
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
132 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
133 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
134 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
135
5090
455bc74f7034 Fixed bug #1100
Sam Lantinga <slouken@libsdl.org>
parents: 5088
diff changeset
136 #if SDL_VIDEO_OPENGL_WGL
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
137 device->GL_LoadLibrary = WIN_GL_LoadLibrary;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
138 device->GL_GetProcAddress = WIN_GL_GetProcAddress;
3057
089a77aebb7d Added test program for SDL_CreateWindowFrom()
Sam Lantinga <slouken@libsdl.org>
parents: 3013
diff changeset
139 device->GL_UnloadLibrary = WIN_GL_UnloadLibrary;
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
140 device->GL_CreateContext = WIN_GL_CreateContext;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
141 device->GL_MakeCurrent = WIN_GL_MakeCurrent;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
142 device->GL_SetSwapInterval = WIN_GL_SetSwapInterval;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
143 device->GL_GetSwapInterval = WIN_GL_GetSwapInterval;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
144 device->GL_SwapWindow = WIN_GL_SwapWindow;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
145 device->GL_DeleteContext = WIN_GL_DeleteContext;
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1905
diff changeset
146 #endif
4761
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
147 device->StartTextInput = WIN_StartTextInput;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
148 device->StopTextInput = WIN_StopTextInput;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
149 device->SetTextInputRect = WIN_SetTextInputRect;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
150
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
151 device->SetClipboardText = WIN_SetClipboardText;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
152 device->GetClipboardText = WIN_GetClipboardText;
bb2e32f5a556 Removed spurious carriage returns
Sam Lantinga <slouken@libsdl.org>
parents: 4755
diff changeset
153 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
154
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
155 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
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 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
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
5062
e8916fe9cfc8 Fixed bug #925
Sam Lantinga <slouken@libsdl.org>
parents: 4919
diff changeset
160 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
161 "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
162 };
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
163
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 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
165 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
166 {
3521
76f9b76ddf0f Don't add any renderers if you can't add any displays
Sam Lantinga <slouken@libsdl.org>
parents: 3168
diff changeset
167 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
168 return -1;
76f9b76ddf0f Don't add any renderers if you can't add any displays
Sam Lantinga <slouken@libsdl.org>
parents: 3168
diff changeset
169 }
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
170
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
171 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
172 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
173
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 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
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
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 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
178 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
179 {
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_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
181 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
182 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
183 }
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
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 /* vim: set ts=4 sw=4 expandtab: */