Mercurial > sdl-ios-xcode
annotate src/video/win32/SDL_win32window.c @ 4486:237b1eb53e4d
Fixed fullscreen window position
Fixed position calculation for centered windows
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 06 Jul 2010 08:22:36 -0700 |
parents | 3e69e077cb95 |
children | eff4e88cc1e8 |
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 | 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 */ |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
22 |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
23 /* we need to define it, so that raw input is included */ |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
24 |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
25 #if (_WIN32_WINNT < 0x0501) |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
26 #undef _WIN32_WINNT |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
27 #define _WIN32_WINNT 0x0501 |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
28 #endif |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
29 |
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
|
30 #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
|
31 |
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 #include "../SDL_sysvideo.h" |
2970
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
33 #include "../SDL_pixels_c.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
|
34 #include "../../events/SDL_keyboard_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
|
35 |
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 #include "SDL_win32video.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
|
37 |
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
|
38 /* This is included after SDL_win32video.h, which includes windows.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
|
39 #include "SDL_syswm.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
|
40 |
3168 | 41 |
42 #define SHFS_SHOWTASKBAR 0x0001 | |
43 #define SHFS_HIDETASKBAR 0x0002 | |
44 #define SHFS_SHOWSIPBUTTON 0x0004 | |
45 #define SHFS_HIDESIPBUTTON 0x0008 | |
46 #define SHFS_SHOWSTARTICON 0x0010 | |
47 #define SHFS_HIDESTARTICON 0x0020 | |
48 | |
49 #ifdef _WIN32_WCE | |
50 // dynamically load aygshell dll because we want SDL to work on HPC and be300 | |
51 int aygshell_loaded = 0; | |
52 BOOL(WINAPI * SHFullScreen) (HWND hwndRequester, DWORD dwState) = 0; | |
53 | |
54 | |
55 static BOOL | |
56 CE_SHFullScreen(HWND hwndRequester, DWORD dwState) | |
57 { | |
58 if (SHFullScreen == 0 && aygshell_loaded == 0) { | |
59 aygshell_loaded = 0; | |
60 void *lib = SDL_LoadObject("aygshell.dll"); | |
61 if (lib) { | |
62 SHFullScreen = | |
63 (BOOL(WINAPI *) (HWND, DWORD)) SDL_LoadFunction(lib, | |
64 "SHFullScreen"); | |
65 } | |
66 } | |
67 | |
68 if (SHFullScreen) { | |
69 SHFullScreen(hwndRequester, dwState); | |
70 //printf("SHFullscreen(%i)\n",dwState); | |
71 } | |
72 } | |
73 | |
74 #endif | |
75 | |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
76 /* Fake window to help with DirectInput events. */ |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
77 HWND SDL_HelperWindow = NULL; |
2714
1d1be6137875
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
Sam Lantinga <slouken@libsdl.org>
parents:
2713
diff
changeset
|
78 static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher"); |
1d1be6137875
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
Sam Lantinga <slouken@libsdl.org>
parents:
2713
diff
changeset
|
79 static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow"); |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
80 static ATOM SDL_HelperWindowClass = 0; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
81 |
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 static int |
1951
7177581dc9fa
Initial work on X11 window code in.
Sam Lantinga <slouken@libsdl.org>
parents:
1913
diff
changeset
|
83 SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created) |
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
|
84 { |
1951
7177581dc9fa
Initial work on X11 window code in.
Sam Lantinga <slouken@libsdl.org>
parents:
1913
diff
changeset
|
85 SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata; |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3566
diff
changeset
|
86 SDL_VideoDisplay *display = window->display; |
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
|
87 SDL_WindowData *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 |
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 /* Allocate the window 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
|
90 data = (SDL_WindowData *) SDL_malloc(sizeof(*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
|
91 if (!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
|
92 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
|
93 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
|
94 } |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3566
diff
changeset
|
95 data->window = window; |
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
|
96 data->hwnd = hwnd; |
1913
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
97 data->hdc = GetDC(hwnd); |
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
|
98 data->created = created; |
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
|
99 data->mouse_pressed = SDL_FALSE; |
1951
7177581dc9fa
Initial work on X11 window code in.
Sam Lantinga <slouken@libsdl.org>
parents:
1913
diff
changeset
|
100 data->videodata = videodata; |
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
|
101 |
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
|
102 /* Associate the data with the window */ |
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
|
103 if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) { |
1913
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
104 ReleaseDC(hwnd, data->hdc); |
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 SDL_free(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
|
106 WIN_SetError("SetProp() failed"); |
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 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
|
108 } |
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 |
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 /* Set up the window proc function */ |
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 data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC); |
3566 | 112 if (data->wndproc == DefWindowProc) { |
113 data->wndproc = 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
|
114 } |
3566 | 115 SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc); |
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
|
116 |
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 /* Fill in the SDL window with the window 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
|
118 { |
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 POINT point; |
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 point.x = 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
|
121 point.y = 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
|
122 if (ClientToScreen(hwnd, &point)) { |
3530
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
123 SDL_Rect bounds; |
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
124 WIN_GetDisplayBounds(_this, display, &bounds); |
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
125 window->x = point.x - bounds.x; |
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
126 window->y = point.y - bounds.y; |
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
|
127 } |
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 } |
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 { |
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 RECT rect; |
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
|
131 if (GetClientRect(hwnd, &rect)) { |
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
|
132 window->w = rect.right; |
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
|
133 window->h = rect.bottom; |
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
|
134 } |
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
|
135 } |
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
|
136 { |
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
|
137 DWORD style = GetWindowLong(hwnd, GWL_STYLE); |
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
|
138 if (style & WS_VISIBLE) { |
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
|
139 window->flags |= SDL_WINDOW_SHOWN; |
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
|
140 } else { |
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
|
141 window->flags &= ~SDL_WINDOW_SHOWN; |
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
|
142 } |
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
|
143 if (style & (WS_BORDER | WS_THICKFRAME)) { |
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
|
144 window->flags &= ~SDL_WINDOW_BORDERLESS; |
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
|
145 } else { |
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
|
146 window->flags |= SDL_WINDOW_BORDERLESS; |
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
|
147 } |
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
|
148 if (style & WS_THICKFRAME) { |
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
|
149 window->flags |= SDL_WINDOW_RESIZABLE; |
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
|
150 } else { |
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
|
151 window->flags &= ~SDL_WINDOW_RESIZABLE; |
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
|
152 } |
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
|
153 if (style & WS_MAXIMIZE) { |
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 window->flags |= SDL_WINDOW_MAXIMIZED; |
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 } else { |
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 window->flags &= ~SDL_WINDOW_MAXIMIZED; |
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 } |
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 if (style & WS_MINIMIZE) { |
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 window->flags |= SDL_WINDOW_MINIMIZED; |
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 } else { |
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 window->flags &= ~SDL_WINDOW_MINIMIZED; |
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 if (GetFocus() == hwnd) { |
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 window->flags |= SDL_WINDOW_INPUT_FOCUS; |
4465
3e69e077cb95
Removed multi-mouse / multi-keyboard support in anticipation of a real multi-mouse and multi-touch API.
Sam Lantinga <slouken@libsdl.org>
parents:
3697
diff
changeset
|
166 SDL_SetKeyboardFocus(data->window); |
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
|
167 |
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 if (window->flags & SDL_WINDOW_INPUT_GRABBED) { |
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
|
169 RECT rect; |
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 GetClientRect(hwnd, &rect); |
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 ClientToScreen(hwnd, (LPPOINT) & rect); |
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 ClientToScreen(hwnd, (LPPOINT) & rect + 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
|
173 ClipCursor(&rect); |
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 } |
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 /* All done! */ |
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 window->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
|
179 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
|
180 } |
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 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
|
183 WIN_CreateWindow(_THIS, SDL_Window * window) |
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 { |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3566
diff
changeset
|
185 SDL_VideoDisplay *display = window->display; |
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
|
186 HWND hwnd; |
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 RECT rect; |
3528
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
188 SDL_Rect bounds; |
1913
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
189 DWORD style = (WS_CLIPSIBLINGS | WS_CLIPCHILDREN); |
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
|
190 int x, y; |
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
|
191 int w, 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
|
192 |
2876 | 193 if (window->flags & (SDL_WINDOW_BORDERLESS | SDL_WINDOW_FULLSCREEN)) { |
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
|
194 style |= WS_POPUP; |
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
|
195 } else { |
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
|
196 style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX); |
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
|
197 } |
2876 | 198 if ((window->flags & SDL_WINDOW_RESIZABLE) |
199 && !(window->flags & SDL_WINDOW_FULLSCREEN)) { | |
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
|
200 style |= (WS_THICKFRAME | WS_MAXIMIZEBOX); |
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
|
201 } |
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
|
202 |
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
|
203 /* Figure out what the window area will be */ |
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
|
204 rect.left = 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
|
205 rect.top = 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
|
206 rect.right = window->w; |
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
|
207 rect.bottom = window->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
|
208 AdjustWindowRectEx(&rect, style, FALSE, 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
|
209 w = (rect.right - rect.left); |
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
|
210 h = (rect.bottom - rect.top); |
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
|
211 |
3528
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
212 WIN_GetDisplayBounds(_this, display, &bounds); |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
213 if (window->flags & SDL_WINDOW_FULLSCREEN) { |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
214 /* The bounds when this window is visible is the fullscreen mode */ |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
215 SDL_DisplayMode fullscreen_mode; |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
216 if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) { |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
217 bounds.w = fullscreen_mode.w; |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
218 bounds.h = fullscreen_mode.h; |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
219 } |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
220 } |
2876 | 221 if ((window->flags & SDL_WINDOW_FULLSCREEN) |
222 || window->x == SDL_WINDOWPOS_CENTERED) { | |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
223 x = bounds.x + (bounds.w - w) / 2; |
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
|
224 } else if (window->x == SDL_WINDOWPOS_UNDEFINED) { |
3528
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
225 if (bounds.x == 0) { |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
226 x = CW_USEDEFAULT; |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
227 } else { |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
228 x = bounds.x; |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
229 } |
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
|
230 } else { |
3530
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
231 x = bounds.x + window->x + rect.left; |
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
|
232 } |
2876 | 233 if ((window->flags & SDL_WINDOW_FULLSCREEN) |
234 || window->y == SDL_WINDOWPOS_CENTERED) { | |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
235 y = bounds.y + (bounds.h - h) / 2; |
3528
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
236 } else if (window->x == SDL_WINDOWPOS_UNDEFINED) { |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
237 if (bounds.x == 0) { |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
238 y = CW_USEDEFAULT; |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
239 } else { |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
240 y = bounds.y; |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
241 } |
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
|
242 } else { |
3530
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
243 y = bounds.y + window->y + rect.top; |
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
|
244 } |
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
|
245 |
1956
ba0d62354872
Simplified driver window creation code.
Sam Lantinga <slouken@libsdl.org>
parents:
1952
diff
changeset
|
246 hwnd = |
ba0d62354872
Simplified driver window creation code.
Sam Lantinga <slouken@libsdl.org>
parents:
1952
diff
changeset
|
247 CreateWindow(SDL_Appname, TEXT(""), style, x, y, w, h, NULL, NULL, |
ba0d62354872
Simplified driver window creation code.
Sam Lantinga <slouken@libsdl.org>
parents:
1952
diff
changeset
|
248 SDL_Instance, 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
|
249 if (!hwnd) { |
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
|
250 WIN_SetError("Couldn't create window"); |
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
|
251 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
|
252 } |
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
|
253 |
2710
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
254 WIN_PumpEvents(_this); |
44e49d3fa6cf
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
1956
diff
changeset
|
255 |
1951
7177581dc9fa
Initial work on X11 window code in.
Sam Lantinga <slouken@libsdl.org>
parents:
1913
diff
changeset
|
256 if (SetupWindowData(_this, window, hwnd, SDL_TRUE) < 0) { |
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
|
257 DestroyWindow(hwnd); |
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
|
258 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
|
259 } |
1952
420716272158
Implemented X11 OpenGL support.
Sam Lantinga <slouken@libsdl.org>
parents:
1951
diff
changeset
|
260 #ifdef SDL_VIDEO_OPENGL_WGL |
1913
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
261 if (window->flags & SDL_WINDOW_OPENGL) { |
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
262 if (WIN_GL_SetupWindow(_this, window) < 0) { |
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
263 WIN_DestroyWindow(_this, window); |
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
264 return -1; |
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
265 } |
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
266 } |
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
267 #endif |
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
|
268 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
|
269 } |
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
|
270 |
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
|
271 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
|
272 WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *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
|
273 { |
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
|
274 HWND hwnd = (HWND) 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
|
275 LPTSTR title; |
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
|
276 int titleLen; |
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
|
277 |
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
|
278 /* Query the title from the existing window */ |
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
|
279 titleLen = GetWindowTextLength(hwnd); |
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
|
280 title = SDL_stack_alloc(TCHAR, titleLen + 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
|
281 if (title) { |
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
|
282 titleLen = GetWindowText(hwnd, title, titleLen); |
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
|
283 } else { |
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
|
284 titleLen = 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
|
285 } |
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
|
286 if (titleLen > 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
|
287 window->title = WIN_StringToUTF8(title); |
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
|
288 } |
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
|
289 if (title) { |
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
|
290 SDL_stack_free(title); |
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
|
291 } |
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
|
292 |
1951
7177581dc9fa
Initial work on X11 window code in.
Sam Lantinga <slouken@libsdl.org>
parents:
1913
diff
changeset
|
293 if (SetupWindowData(_this, window, hwnd, SDL_FALSE) < 0) { |
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
|
294 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
|
295 } |
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
|
296 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
|
297 } |
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
|
298 |
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
|
299 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
|
300 WIN_SetWindowTitle(_THIS, SDL_Window * window) |
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
|
301 { |
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
|
302 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
303 LPTSTR title; |
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
|
304 |
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
|
305 if (window->title) { |
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
|
306 title = WIN_UTF8ToString(window->title); |
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
|
307 } else { |
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
|
308 title = 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
|
309 } |
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
|
310 SetWindowText(hwnd, title ? title : TEXT("")); |
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
|
311 if (title) { |
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
|
312 SDL_free(title); |
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
|
313 } |
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
|
314 } |
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
|
315 |
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
|
316 void |
2970
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
317 WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon) |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
318 { |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
319 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
320 HICON hicon = NULL; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
321 |
2990 | 322 if (icon) { |
2970
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
323 BYTE *icon_bmp; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
324 int icon_len; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
325 SDL_RWops *dst; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
326 SDL_PixelFormat format; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
327 SDL_Surface *surface; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
328 |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
329 /* Create temporary bitmap buffer */ |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
330 icon_len = 40 + icon->h * icon->w * 4; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
331 icon_bmp = SDL_stack_alloc(BYTE, icon_len); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
332 dst = SDL_RWFromMem(icon_bmp, icon_len); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
333 if (!dst) { |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
334 SDL_stack_free(icon_bmp); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
335 return; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
336 } |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
337 |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
338 /* Write the BITMAPINFO header */ |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
339 SDL_WriteLE32(dst, 40); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
340 SDL_WriteLE32(dst, icon->w); |
2990 | 341 SDL_WriteLE32(dst, icon->h * 2); |
2970
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
342 SDL_WriteLE16(dst, 1); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
343 SDL_WriteLE16(dst, 32); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
344 SDL_WriteLE32(dst, BI_RGB); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
345 SDL_WriteLE32(dst, icon->h * icon->w * 4); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
346 SDL_WriteLE32(dst, 0); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
347 SDL_WriteLE32(dst, 0); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
348 SDL_WriteLE32(dst, 0); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
349 SDL_WriteLE32(dst, 0); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
350 |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
351 /* Convert the icon to a 32-bit surface with alpha channel */ |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
352 SDL_InitFormat(&format, 32, |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
353 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
354 surface = SDL_ConvertSurface(icon, &format, 0); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
355 if (surface) { |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
356 /* Write the pixels upside down into the bitmap buffer */ |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
357 int y = surface->h; |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
358 while (y--) { |
2990 | 359 Uint8 *src = (Uint8 *) surface->pixels + y * surface->pitch; |
2970
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
360 SDL_RWwrite(dst, src, surface->pitch, 1); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
361 } |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
362 SDL_FreeSurface(surface); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
363 |
3097
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
364 /* TODO: create the icon in WinCE (CreateIconFromResource isn't available) */ |
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
365 #ifndef _WIN32_WCE |
2990 | 366 hicon = |
367 CreateIconFromResource(icon_bmp, icon_len, TRUE, 0x00030000); | |
3097
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
368 #endif |
2970
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
369 } |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
370 SDL_RWclose(dst); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
371 SDL_stack_free(icon_bmp); |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
372 } |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
373 |
2971
a3012c6652ff
Should we also set the icon in the task manager?
Sam Lantinga <slouken@libsdl.org>
parents:
2970
diff
changeset
|
374 /* Set the icon for the window */ |
2990 | 375 SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) hicon); |
2971
a3012c6652ff
Should we also set the icon in the task manager?
Sam Lantinga <slouken@libsdl.org>
parents:
2970
diff
changeset
|
376 |
a3012c6652ff
Should we also set the icon in the task manager?
Sam Lantinga <slouken@libsdl.org>
parents:
2970
diff
changeset
|
377 /* Set the icon in the task manager (should we do this?) */ |
2990 | 378 SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) hicon); |
2970
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
379 } |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
380 |
94b634c56455
Added support for translucent icons on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
2968
diff
changeset
|
381 void |
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
|
382 WIN_SetWindowPosition(_THIS, SDL_Window * window) |
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
|
383 { |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3566
diff
changeset
|
384 SDL_VideoDisplay *display = window->display; |
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
|
385 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
386 RECT rect; |
3528
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
387 SDL_Rect bounds; |
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
|
388 DWORD style; |
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
|
389 HWND top; |
3168 | 390 BOOL menu; |
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
|
391 int x, y; |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
392 int w, 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
|
393 |
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
|
394 /* Figure out what the window area will be */ |
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
|
395 if (window->flags & SDL_WINDOW_FULLSCREEN) { |
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
|
396 top = HWND_TOPMOST; |
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
|
397 } else { |
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
|
398 top = HWND_NOTOPMOST; |
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
|
399 } |
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
|
400 style = GetWindowLong(hwnd, GWL_STYLE); |
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
|
401 rect.left = 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
|
402 rect.top = 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
|
403 rect.right = window->w; |
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
|
404 rect.bottom = window->h; |
3168 | 405 #ifdef _WIN32_WCE |
406 menu = FALSE; | |
407 #else | |
408 menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); | |
409 #endif | |
410 AdjustWindowRectEx(&rect, style, menu, 0); | |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
411 w = (rect.right - rect.left); |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
412 h = (rect.bottom - rect.top); |
2875
91a7e08cd238
* Implemented X11 fullscreen input grab
Sam Lantinga <slouken@libsdl.org>
parents:
2865
diff
changeset
|
413 |
3528
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3196
diff
changeset
|
414 WIN_GetDisplayBounds(_this, display, &bounds); |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
415 if (window->flags & SDL_WINDOW_FULLSCREEN) { |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
416 /* The bounds when this window is visible is the fullscreen mode */ |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
417 SDL_DisplayMode fullscreen_mode; |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
418 if (SDL_GetWindowDisplayMode(window, &fullscreen_mode) == 0) { |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
419 bounds.w = fullscreen_mode.w; |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
420 bounds.h = fullscreen_mode.h; |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
421 } |
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
422 } |
2876 | 423 if ((window->flags & SDL_WINDOW_FULLSCREEN) |
424 || window->x == SDL_WINDOWPOS_CENTERED) { | |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
425 x = bounds.x + (bounds.w - w) / 2; |
2875
91a7e08cd238
* Implemented X11 fullscreen input grab
Sam Lantinga <slouken@libsdl.org>
parents:
2865
diff
changeset
|
426 } else { |
3530
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
427 x = bounds.x + window->x + rect.left; |
2875
91a7e08cd238
* Implemented X11 fullscreen input grab
Sam Lantinga <slouken@libsdl.org>
parents:
2865
diff
changeset
|
428 } |
2876 | 429 if ((window->flags & SDL_WINDOW_FULLSCREEN) |
430 || window->y == SDL_WINDOWPOS_CENTERED) { | |
4486
237b1eb53e4d
Fixed fullscreen window position
Sam Lantinga <slouken@libsdl.org>
parents:
4465
diff
changeset
|
431 y = bounds.y + (bounds.h - h) / 2; |
2875
91a7e08cd238
* Implemented X11 fullscreen input grab
Sam Lantinga <slouken@libsdl.org>
parents:
2865
diff
changeset
|
432 } else { |
3530
e96be66e3673
The window position is display relative, at least for now...
Sam Lantinga <slouken@libsdl.org>
parents:
3528
diff
changeset
|
433 y = bounds.y + window->y + rect.top; |
2875
91a7e08cd238
* Implemented X11 fullscreen input grab
Sam Lantinga <slouken@libsdl.org>
parents:
2865
diff
changeset
|
434 } |
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
|
435 |
1956
ba0d62354872
Simplified driver window creation code.
Sam Lantinga <slouken@libsdl.org>
parents:
1952
diff
changeset
|
436 SetWindowPos(hwnd, top, x, y, 0, 0, (SWP_NOCOPYBITS | SWP_NOSIZE)); |
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
|
437 } |
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
|
438 |
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
|
439 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
|
440 WIN_SetWindowSize(_THIS, SDL_Window * window) |
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
|
441 { |
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
|
442 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
443 RECT rect; |
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
|
444 DWORD style; |
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
|
445 HWND top; |
3168 | 446 BOOL menu; |
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
|
447 int w, 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
|
448 |
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
|
449 /* Figure out what the window area will be */ |
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
|
450 if (window->flags & SDL_WINDOW_FULLSCREEN) { |
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
|
451 top = HWND_TOPMOST; |
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
|
452 } else { |
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
|
453 top = HWND_NOTOPMOST; |
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
|
454 } |
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
|
455 style = GetWindowLong(hwnd, GWL_STYLE); |
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
|
456 rect.left = 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
|
457 rect.top = 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
|
458 rect.right = window->w; |
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
|
459 rect.bottom = window->h; |
3168 | 460 #ifdef _WIN32_WCE |
461 menu = FALSE; | |
462 #else | |
463 menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL); | |
464 #endif | |
465 AdjustWindowRectEx(&rect, style, menu, 0); | |
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
|
466 w = (rect.right - rect.left); |
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
|
467 h = (rect.bottom - rect.top); |
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
|
468 |
2968
efe4d0ce2e97
Date: Fri, 02 Jan 2009 23:22:39 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2876
diff
changeset
|
469 SetWindowPos(hwnd, top, 0, 0, w, h, (SWP_NOCOPYBITS | SWP_NOMOVE)); |
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
|
470 } |
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
|
471 |
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
|
472 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
|
473 WIN_ShowWindow(_THIS, SDL_Window * window) |
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
|
474 { |
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
|
475 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
476 |
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
|
477 ShowWindow(hwnd, SW_SHOW); |
3168 | 478 |
479 #ifdef _WIN32_WCE | |
480 if (window->flags & SDL_WINDOW_FULLSCREEN) { | |
481 CE_SHFullScreen(hwnd, | |
482 SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | | |
483 SHFS_HIDESIPBUTTON); | |
484 } | |
485 #endif | |
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
|
486 } |
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
|
487 |
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
|
488 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
|
489 WIN_HideWindow(_THIS, SDL_Window * window) |
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
|
490 { |
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
|
491 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
492 |
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
|
493 ShowWindow(hwnd, SW_HIDE); |
3168 | 494 |
495 #ifdef _WIN32_WCE | |
496 if (window->flags & SDL_WINDOW_FULLSCREEN) { | |
497 CE_SHFullScreen(hwnd, | |
498 SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR | | |
499 SHFS_SHOWSIPBUTTON); | |
500 } | |
501 #endif | |
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
|
502 } |
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
|
503 |
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
|
504 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
|
505 WIN_RaiseWindow(_THIS, SDL_Window * window) |
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
|
506 { |
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
|
507 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
508 HWND top; |
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
|
509 |
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
|
510 if (window->flags & SDL_WINDOW_FULLSCREEN) { |
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
|
511 top = HWND_TOPMOST; |
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
|
512 } else { |
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
|
513 top = HWND_NOTOPMOST; |
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
|
514 } |
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
|
515 SetWindowPos(hwnd, top, 0, 0, 0, 0, (SWP_NOMOVE | SWP_NOSIZE)); |
3168 | 516 |
517 #ifdef _WIN32_WCE | |
518 if (window->flags & SDL_WINDOW_FULLSCREEN) { | |
519 CE_SHFullScreen(hwnd, | |
520 SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | | |
521 SHFS_HIDESIPBUTTON); | |
522 } | |
523 #endif | |
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
|
524 } |
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
|
525 |
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
|
526 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
|
527 WIN_MaximizeWindow(_THIS, SDL_Window * window) |
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
|
528 { |
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
|
529 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
530 |
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
|
531 ShowWindow(hwnd, SW_MAXIMIZE); |
3168 | 532 |
533 #ifdef _WIN32_WCE | |
534 if (window->flags & SDL_WINDOW_FULLSCREEN) { | |
535 CE_SHFullScreen(hwnd, | |
536 SHFS_HIDESTARTICON | SHFS_HIDETASKBAR | | |
537 SHFS_HIDESIPBUTTON); | |
538 } | |
539 #endif | |
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
|
540 } |
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
|
541 |
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
|
542 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
|
543 WIN_MinimizeWindow(_THIS, SDL_Window * window) |
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
|
544 { |
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
|
545 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
546 |
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
|
547 ShowWindow(hwnd, SW_MINIMIZE); |
3168 | 548 |
549 #ifdef _WIN32_WCE | |
550 if (window->flags & SDL_WINDOW_FULLSCREEN) { | |
551 CE_SHFullScreen(hwnd, | |
552 SHFS_SHOWSTARTICON | SHFS_SHOWTASKBAR | | |
553 SHFS_SHOWSIPBUTTON); | |
554 } | |
555 #endif | |
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
|
556 } |
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
|
557 |
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
|
558 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
|
559 WIN_RestoreWindow(_THIS, SDL_Window * window) |
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
|
560 { |
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
|
561 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
562 |
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
|
563 ShowWindow(hwnd, SW_RESTORE); |
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
|
564 } |
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
|
565 |
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
|
566 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
|
567 WIN_SetWindowGrab(_THIS, SDL_Window * window) |
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
|
568 { |
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
|
569 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
570 |
2876 | 571 if ((window->flags & (SDL_WINDOW_INPUT_GRABBED | SDL_WINDOW_FULLSCREEN)) |
572 && (window->flags & SDL_WINDOW_INPUT_FOCUS)) { | |
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
|
573 RECT rect; |
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
|
574 GetClientRect(hwnd, &rect); |
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
|
575 ClientToScreen(hwnd, (LPPOINT) & rect); |
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
|
576 ClientToScreen(hwnd, (LPPOINT) & rect + 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
|
577 ClipCursor(&rect); |
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
|
578 } else { |
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
|
579 ClipCursor(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
|
580 } |
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
|
581 } |
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
|
582 |
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
|
583 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
|
584 WIN_DestroyWindow(_THIS, SDL_Window * window) |
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
|
585 { |
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
|
586 SDL_WindowData *data = (SDL_WindowData *) window->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
|
587 |
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
|
588 if (data) { |
1913
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1895
diff
changeset
|
589 ReleaseDC(data->hwnd, data->hdc); |
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
|
590 if (data->created) { |
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
|
591 DestroyWindow(data->hwnd); |
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
|
592 } |
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
|
593 SDL_free(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
|
594 } |
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
|
595 } |
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
|
596 |
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
|
597 SDL_bool |
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
|
598 WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) |
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
|
599 { |
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
|
600 HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd; |
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
|
601 if (info->version.major <= SDL_MAJOR_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
|
602 info->window = hwnd; |
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
|
603 return SDL_TRUE; |
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
|
604 } else { |
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
|
605 SDL_SetError("Application not compiled with SDL %d.%d\n", |
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
|
606 SDL_MAJOR_VERSION, SDL_MINOR_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
|
607 return SDL_FALSE; |
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
|
608 } |
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
|
609 } |
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
|
610 |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
611 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
612 /* |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
613 * Creates a HelperWindow used for DirectInput events. |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
614 */ |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
615 int |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
616 SDL_HelperWindowCreate(void) |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
617 { |
3097
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
618 HINSTANCE hInstance = GetModuleHandle(NULL); |
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
619 WNDCLASS wce; |
3196
413672b09bb3
Fixed some compile errors and warnings under Visual C++
Sam Lantinga <slouken@libsdl.org>
parents:
3168
diff
changeset
|
620 HWND hWndParent = NULL; |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
621 |
3045
9acb9f0f7f0d
Some more safety around the SDL_HelperWindow stuff to avoid double creations.
Edgar Simo <bobbens@gmail.com>
parents:
2990
diff
changeset
|
622 /* Make sure window isn't created twice. */ |
9acb9f0f7f0d
Some more safety around the SDL_HelperWindow stuff to avoid double creations.
Edgar Simo <bobbens@gmail.com>
parents:
2990
diff
changeset
|
623 if (SDL_HelperWindow != NULL) { |
9acb9f0f7f0d
Some more safety around the SDL_HelperWindow stuff to avoid double creations.
Edgar Simo <bobbens@gmail.com>
parents:
2990
diff
changeset
|
624 return 0; |
9acb9f0f7f0d
Some more safety around the SDL_HelperWindow stuff to avoid double creations.
Edgar Simo <bobbens@gmail.com>
parents:
2990
diff
changeset
|
625 } |
9acb9f0f7f0d
Some more safety around the SDL_HelperWindow stuff to avoid double creations.
Edgar Simo <bobbens@gmail.com>
parents:
2990
diff
changeset
|
626 |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
627 /* Create the class. */ |
2714
1d1be6137875
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
Sam Lantinga <slouken@libsdl.org>
parents:
2713
diff
changeset
|
628 SDL_zero(wce); |
3097
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
629 wce.lpfnWndProc = DefWindowProc; |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
630 wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
631 wce.hInstance = hInstance; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
632 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
633 /* Register the class. */ |
3097
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
634 SDL_HelperWindowClass = RegisterClass(&wce); |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
635 if (SDL_HelperWindowClass == 0) { |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
636 SDL_SetError("Unable to create Helper Window Class: error %d.", |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
637 GetLastError()); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
638 return -1; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
639 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
640 |
3168 | 641 #ifndef _WIN32_WCE |
642 /* WinCE doesn't have HWND_MESSAGE */ | |
643 hWndParent = HWND_MESSAGE; | |
644 #endif | |
645 | |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
646 /* Create the window. */ |
2714
1d1be6137875
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
Sam Lantinga <slouken@libsdl.org>
parents:
2713
diff
changeset
|
647 SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName, |
1d1be6137875
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
Sam Lantinga <slouken@libsdl.org>
parents:
2713
diff
changeset
|
648 SDL_HelperWindowName, |
3168 | 649 WS_OVERLAPPED, CW_USEDEFAULT, |
2714
1d1be6137875
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
Sam Lantinga <slouken@libsdl.org>
parents:
2713
diff
changeset
|
650 CW_USEDEFAULT, CW_USEDEFAULT, |
3168 | 651 CW_USEDEFAULT, hWndParent, NULL, |
2714
1d1be6137875
Merged last minute fixes from force feedback branch (r4031, r4033, r4034)
Sam Lantinga <slouken@libsdl.org>
parents:
2713
diff
changeset
|
652 hInstance, NULL); |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
653 if (SDL_HelperWindow == NULL) { |
3045
9acb9f0f7f0d
Some more safety around the SDL_HelperWindow stuff to avoid double creations.
Edgar Simo <bobbens@gmail.com>
parents:
2990
diff
changeset
|
654 UnregisterClass(SDL_HelperWindowClassName, hInstance); |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
655 SDL_SetError("Unable to create Helper Window: error %d.", |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
656 GetLastError()); |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
657 return -1; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
658 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
659 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
660 return 0; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
661 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
662 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
663 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
664 /* |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
665 * Destroys the HelperWindow previously created with SDL_HelperWindowCreate. |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
666 */ |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
667 void |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
668 SDL_HelperWindowDestroy(void) |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
669 { |
3097
0d12e8f1de3c
Date: Thu, 05 Feb 2009 18:07:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
670 HINSTANCE hInstance = GetModuleHandle(NULL); |
2863
b632927c28c8
Some error checking when destroying the HelperWindow.
Edgar Simo <bobbens@gmail.com>
parents:
2859
diff
changeset
|
671 |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
672 /* Destroy the window. */ |
2863
b632927c28c8
Some error checking when destroying the HelperWindow.
Edgar Simo <bobbens@gmail.com>
parents:
2859
diff
changeset
|
673 if (SDL_HelperWindow != NULL) { |
b632927c28c8
Some error checking when destroying the HelperWindow.
Edgar Simo <bobbens@gmail.com>
parents:
2859
diff
changeset
|
674 if (DestroyWindow(SDL_HelperWindow) == 0) { |
2865 | 675 SDL_SetError("Unable to destroy Helper Window: error %d.", |
676 GetLastError()); | |
677 return; | |
2863
b632927c28c8
Some error checking when destroying the HelperWindow.
Edgar Simo <bobbens@gmail.com>
parents:
2859
diff
changeset
|
678 } |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
679 SDL_HelperWindow = NULL; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
680 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
681 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
682 /* Unregister the class. */ |
2863
b632927c28c8
Some error checking when destroying the HelperWindow.
Edgar Simo <bobbens@gmail.com>
parents:
2859
diff
changeset
|
683 if (SDL_HelperWindowClass != 0) { |
b632927c28c8
Some error checking when destroying the HelperWindow.
Edgar Simo <bobbens@gmail.com>
parents:
2859
diff
changeset
|
684 if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) { |
2865 | 685 SDL_SetError("Unable to destroy Helper Window Class: error %d.", |
686 GetLastError()); | |
687 return; | |
2863
b632927c28c8
Some error checking when destroying the HelperWindow.
Edgar Simo <bobbens@gmail.com>
parents:
2859
diff
changeset
|
688 } |
2713
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
689 SDL_HelperWindowClass = 0; |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
690 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
691 } |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
692 |
0906692aa6a4
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2710
diff
changeset
|
693 |
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
|
694 /* vi: set ts=4 sw=4 expandtab: */ |