Mercurial > sdl-ios-xcode
annotate src/video/windib/SDL_dibevents.c @ 1303:52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
From: Sean Childs
Subject: [SDL] Compiling SDL 1.2.8 with the free Borland compiler
When compiling SDL 1.2.8 with the free Borland compiler, I received this
error (there is a similar error that occurs in
src\video\windx5\sdl_dx5events.c):
Error E2342 ..\..\src\video\windib\sdl_dibevents.c 189: Type mismatch in
parameter 'lpPrevWndFunc' (wanted 'int (__stdcall *)()', got 'long
(__stdcall *)(void *,unsigned int,unsigned int,long)') in function
DIB_HandleMessage
I checked the MSDN library at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/
windowsuserinterface/windowing/windowprocedures/windowprocedurereference/wind
owprocedurefunctions/callwindowproc.asp
and it had this to say:
If STRICT is not defined, the lpPrevWndFunc parameter has the data type
FARPROC. The FARPROC type is declared as follows:
int (FAR WINAPI * FARPROC) ()
In C, the FARPROC declaration indicates a callback function that has an
unspecified parameter list. In C++, however, the empty parameter list in
the declaration indicates that a function has no parameters. This subtle
distinction can break careless code. Following is one way to handle this
situation:
#ifdef STRICT
WNDPROC MyWindowProcedure
#else
FARPROC MyWindowProcedure
#endif
...
lResult = CallWindowProc(MyWindowProcedure, ...)
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 31 Jan 2006 15:30:42 +0000 |
parents | ea3888b472bf |
children | c9b51268668f |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
769
b8d311d90021
Updated copyright information for 2004 (Happy New Year!)
Sam Lantinga <slouken@libsdl.org>
parents:
726
diff
changeset
|
3 Copyright (C) 1997-2004 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
145
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 #ifdef SAVE_RCSID | |
24 static char rcsid = | |
25 "@(#) $Id$"; | |
26 #endif | |
27 | |
28 #include <stdlib.h> | |
29 #include <stdio.h> | |
30 #include <windows.h> | |
31 | |
32 #include "SDL_events.h" | |
33 #include "SDL_error.h" | |
34 #include "SDL_syswm.h" | |
35 #include "SDL_sysevents.h" | |
36 #include "SDL_events_c.h" | |
37 #include "SDL_lowvideo.h" | |
38 #include "SDL_dibvideo.h" | |
39 #include "SDL_vkeys.h" | |
40 | |
41 #ifndef WM_APP | |
42 #define WM_APP 0x8000 | |
43 #endif | |
44 | |
45 #ifdef _WIN32_WCE | |
46 #define NO_GETKEYBOARDSTATE | |
47 #endif | |
48 | |
49 /* The translation table from a Microsoft VK keysym to a SDL keysym */ | |
50 static SDLKey VK_keymap[SDLK_LAST]; | |
51 static SDL_keysym *TranslateKey(UINT vkey, UINT scancode, SDL_keysym *keysym, int pressed); | |
52 | |
53 /* Masks for processing the windows KEYDOWN and KEYUP messages */ | |
54 #define REPEATED_KEYMASK (1<<30) | |
55 #define EXTENDED_KEYMASK (1<<24) | |
56 | |
145
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
57 /* DJM: If the user setup the window for us, we want to save his window proc, |
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
58 and give him a chance to handle some messages. */ |
1303
52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
Sam Lantinga <slouken@libsdl.org>
parents:
1288
diff
changeset
|
59 #ifdef STRICT |
52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
Sam Lantinga <slouken@libsdl.org>
parents:
1288
diff
changeset
|
60 #define WNDPROCTYPE WNDPROC |
52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
Sam Lantinga <slouken@libsdl.org>
parents:
1288
diff
changeset
|
61 #else |
52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
Sam Lantinga <slouken@libsdl.org>
parents:
1288
diff
changeset
|
62 #define WNDPROCTYPE FARPROC |
52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
Sam Lantinga <slouken@libsdl.org>
parents:
1288
diff
changeset
|
63 #endif |
52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
Sam Lantinga <slouken@libsdl.org>
parents:
1288
diff
changeset
|
64 static WNDPROCTYPE userWindowProc = NULL; |
145
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
65 |
1251
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
66 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
67 #ifdef _WIN32_WCE |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
68 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
69 WPARAM rotateKey(WPARAM key,SDL_ScreenOrientation direction) |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
70 { |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
71 if (direction != SDL_ORIENTATION_LEFT) |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
72 return key; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
73 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
74 switch (key) { |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
75 case 0x26: /* up */ |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
76 return 0x27; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
77 case 0x27: /* right */ |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
78 return 0x28; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
79 case 0x28: /* down */ |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
80 return 0x25; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
81 case 0x25: /* left */ |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
82 return 0x26; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
83 } |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
84 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
85 return key; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
86 } |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
87 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
88 #endif |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
89 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
90 |
0 | 91 /* The main Win32 event handler */ |
92 LONG | |
93 DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) | |
94 { | |
95 extern int posted; | |
96 | |
97 switch (msg) { | |
98 case WM_SYSKEYDOWN: | |
99 case WM_KEYDOWN: { | |
100 SDL_keysym keysym; | |
101 | |
1251
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
102 #ifdef _WIN32_WCE |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
103 // Drop GAPI artefacts |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
104 if (wParam == 0x84 || wParam == 0x5B) |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
105 return 0; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
106 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
107 // Rotate key if necessary |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
108 if (this->hidden->orientation != SDL_ORIENTATION_UP) |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
109 wParam = rotateKey(wParam, this->hidden->orientation); |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
110 #endif |
0 | 111 /* Ignore repeated keys */ |
112 if ( lParam&REPEATED_KEYMASK ) { | |
113 return(0); | |
114 } | |
115 switch (wParam) { | |
116 case VK_CONTROL: | |
117 if ( lParam&EXTENDED_KEYMASK ) | |
118 wParam = VK_RCONTROL; | |
119 else | |
120 wParam = VK_LCONTROL; | |
121 break; | |
122 case VK_SHIFT: | |
123 /* EXTENDED trick doesn't work here */ | |
1282
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
124 { |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
125 Uint8 *state = SDL_GetKeyState(NULL); |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
126 if (state[SDLK_LSHIFT] == SDL_RELEASED && (GetKeyState(VK_LSHIFT) & 0x8000)) { |
558
2312d983e1fe
Fixed left/right shift detection on Windows (thanks Mike!)
Sam Lantinga <slouken@libsdl.org>
parents:
523
diff
changeset
|
127 wParam = VK_LSHIFT; |
1282
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
128 } else if (state[SDLK_RSHIFT] == SDL_RELEASED && (GetKeyState(VK_RSHIFT) & 0x8000)) { |
558
2312d983e1fe
Fixed left/right shift detection on Windows (thanks Mike!)
Sam Lantinga <slouken@libsdl.org>
parents:
523
diff
changeset
|
129 wParam = VK_RSHIFT; |
2312d983e1fe
Fixed left/right shift detection on Windows (thanks Mike!)
Sam Lantinga <slouken@libsdl.org>
parents:
523
diff
changeset
|
130 } else { |
1282
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
131 /* Probably a key repeat */ |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
132 return(0); |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
133 } |
558
2312d983e1fe
Fixed left/right shift detection on Windows (thanks Mike!)
Sam Lantinga <slouken@libsdl.org>
parents:
523
diff
changeset
|
134 } |
0 | 135 break; |
136 case VK_MENU: | |
137 if ( lParam&EXTENDED_KEYMASK ) | |
138 wParam = VK_RMENU; | |
139 else | |
140 wParam = VK_LMENU; | |
141 break; | |
142 } | |
112
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
143 #ifdef NO_GETKEYBOARDSTATE |
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
144 /* this is the workaround for the missing ToAscii() and ToUnicode() in CE (not necessary at KEYUP!) */ |
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
145 if ( SDL_TranslateUNICODE ) { |
140
3c35d8f160bd
Fixed compiling on Windows CE
Sam Lantinga <slouken@libsdl.org>
parents:
112
diff
changeset
|
146 MSG m; |
112
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
147 |
140
3c35d8f160bd
Fixed compiling on Windows CE
Sam Lantinga <slouken@libsdl.org>
parents:
112
diff
changeset
|
148 m.hwnd = hwnd; |
3c35d8f160bd
Fixed compiling on Windows CE
Sam Lantinga <slouken@libsdl.org>
parents:
112
diff
changeset
|
149 m.message = msg; |
3c35d8f160bd
Fixed compiling on Windows CE
Sam Lantinga <slouken@libsdl.org>
parents:
112
diff
changeset
|
150 m.wParam = wParam; |
3c35d8f160bd
Fixed compiling on Windows CE
Sam Lantinga <slouken@libsdl.org>
parents:
112
diff
changeset
|
151 m.lParam = lParam; |
3c35d8f160bd
Fixed compiling on Windows CE
Sam Lantinga <slouken@libsdl.org>
parents:
112
diff
changeset
|
152 m.time = 0; |
3c35d8f160bd
Fixed compiling on Windows CE
Sam Lantinga <slouken@libsdl.org>
parents:
112
diff
changeset
|
153 if ( TranslateMessage(&m) && PeekMessage(&m, hwnd, 0, WM_USER, PM_NOREMOVE) && (m.message == WM_CHAR) ) { |
112
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
154 GetMessage(&m, hwnd, 0, WM_USER); |
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
155 wParam = m.wParam; |
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
156 } |
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
157 } |
9ef74357a5fb
Incorporated slightly modified version of Rainer's WinCE patch
Sam Lantinga <slouken@lokigames.com>
parents:
36
diff
changeset
|
158 #endif /* NO_GETKEYBOARDSTATE */ |
0 | 159 posted = SDL_PrivateKeyboard(SDL_PRESSED, |
160 TranslateKey(wParam,HIWORD(lParam),&keysym,1)); | |
161 } | |
162 return(0); | |
163 | |
164 case WM_SYSKEYUP: | |
165 case WM_KEYUP: { | |
166 SDL_keysym keysym; | |
167 | |
1251
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
168 #ifdef _WIN32_WCE |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
169 // Drop GAPI artefacts |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
170 if (wParam == 0x84 || wParam == 0x5B) |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
171 return 0; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
172 |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
173 // Rotate key if necessary |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
174 if (this->hidden->orientation != SDL_ORIENTATION_UP) |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
175 wParam = rotateKey(wParam, this->hidden->orientation); |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
176 #endif |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1152
diff
changeset
|
177 |
0 | 178 switch (wParam) { |
179 case VK_CONTROL: | |
180 if ( lParam&EXTENDED_KEYMASK ) | |
181 wParam = VK_RCONTROL; | |
182 else | |
183 wParam = VK_LCONTROL; | |
184 break; | |
185 case VK_SHIFT: | |
186 /* EXTENDED trick doesn't work here */ | |
1282
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
187 { |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
188 Uint8 *state = SDL_GetKeyState(NULL); |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
189 if (state[SDLK_LSHIFT] == SDL_PRESSED && !(GetKeyState(VK_LSHIFT) & 0x8000)) { |
572
4c740ee76027
Mike Nordell _really_ fixed Win32 windib shift state handling this time. :)
Sam Lantinga <slouken@libsdl.org>
parents:
558
diff
changeset
|
190 wParam = VK_LSHIFT; |
1282
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
191 } else if (state[SDLK_RSHIFT] == SDL_PRESSED && !(GetKeyState(VK_RSHIFT) & 0x8000)) { |
572
4c740ee76027
Mike Nordell _really_ fixed Win32 windib shift state handling this time. :)
Sam Lantinga <slouken@libsdl.org>
parents:
558
diff
changeset
|
192 wParam = VK_RSHIFT; |
4c740ee76027
Mike Nordell _really_ fixed Win32 windib shift state handling this time. :)
Sam Lantinga <slouken@libsdl.org>
parents:
558
diff
changeset
|
193 } else { |
1282
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
194 /* Probably a key repeat */ |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
195 return(0); |
217f5d5a49e5
Date: Sat, 15 Jan 2005 02:01:51 +0000 (UTC)
Sam Lantinga <slouken@libsdl.org>
parents:
1280
diff
changeset
|
196 } |
572
4c740ee76027
Mike Nordell _really_ fixed Win32 windib shift state handling this time. :)
Sam Lantinga <slouken@libsdl.org>
parents:
558
diff
changeset
|
197 } |
0 | 198 break; |
199 case VK_MENU: | |
200 if ( lParam&EXTENDED_KEYMASK ) | |
201 wParam = VK_RMENU; | |
202 else | |
203 wParam = VK_LMENU; | |
204 break; | |
205 } | |
206 posted = SDL_PrivateKeyboard(SDL_RELEASED, | |
207 TranslateKey(wParam,HIWORD(lParam),&keysym,0)); | |
208 } | |
209 return(0); | |
210 | |
726
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
211 #if defined(SC_SCREENSAVE) && defined(SC_MONITORPOWER) |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
212 case WM_SYSCOMMAND: { |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
213 if ((wParam&0xFFF0)==SC_SCREENSAVE || |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
214 (wParam&0xFFF0)==SC_MONITORPOWER) |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
215 return(0); |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
216 } |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
217 /* Fall through to default processing */ |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
218 #endif /* SC_SCREENSAVE && SC_MONITORPOWER */ |
5429a06aa816
SDL12: Disable screensaver in windib driver.
Ryan C. Gordon <icculus@icculus.org>
parents:
721
diff
changeset
|
219 |
0 | 220 default: { |
221 /* Only post the event if we're watching for it */ | |
222 if ( SDL_ProcessEvents[SDL_SYSWMEVENT] == SDL_ENABLE ) { | |
223 SDL_SysWMmsg wmmsg; | |
224 | |
225 SDL_VERSION(&wmmsg.version); | |
226 wmmsg.hwnd = hwnd; | |
227 wmmsg.msg = msg; | |
228 wmmsg.wParam = wParam; | |
229 wmmsg.lParam = lParam; | |
230 posted = SDL_PrivateSysWMEvent(&wmmsg); | |
145
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
231 |
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
232 /* DJM: If the user isn't watching for private |
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
233 messages in her SDL event loop, then pass it |
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
234 along to any win32 specific window proc. |
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
235 */ |
29a638dc26db
Applied David MacCormack's patch to fix SDL_WINDOWID on Windows,
Sam Lantinga <slouken@libsdl.org>
parents:
140
diff
changeset
|
236 } else if (userWindowProc) { |
721
ab0656314eef
Date: Thu, 18 Sep 2003 14:24:35 -0400
Sam Lantinga <slouken@libsdl.org>
parents:
572
diff
changeset
|
237 return CallWindowProc(userWindowProc, hwnd, msg, wParam, lParam); |
0 | 238 } |
239 } | |
240 break; | |
241 } | |
242 return(DefWindowProc(hwnd, msg, wParam, lParam)); | |
243 } | |
244 | |
245 void DIB_PumpEvents(_THIS) | |
246 { | |
247 MSG msg; | |
248 | |
523
c210010f50f4
Fixed windows event handling for ActiveX controls (thanks Huib-Jan!)
Sam Lantinga <slouken@libsdl.org>
parents:
515
diff
changeset
|
249 while ( PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE) ) { |
c210010f50f4
Fixed windows event handling for ActiveX controls (thanks Huib-Jan!)
Sam Lantinga <slouken@libsdl.org>
parents:
515
diff
changeset
|
250 if ( GetMessage(&msg, NULL, 0, 0) > 0 ) { |
0 | 251 DispatchMessage(&msg); |
252 } | |
253 } | |
254 } | |
255 | |
256 void DIB_InitOSKeymap(_THIS) | |
257 { | |
258 int i; | |
259 | |
260 /* Map the VK keysyms */ | |
261 for ( i=0; i<SDL_TABLESIZE(VK_keymap); ++i ) | |
262 VK_keymap[i] = SDLK_UNKNOWN; | |
263 | |
264 VK_keymap[VK_BACK] = SDLK_BACKSPACE; | |
265 VK_keymap[VK_TAB] = SDLK_TAB; | |
266 VK_keymap[VK_CLEAR] = SDLK_CLEAR; | |
267 VK_keymap[VK_RETURN] = SDLK_RETURN; | |
268 VK_keymap[VK_PAUSE] = SDLK_PAUSE; | |
269 VK_keymap[VK_ESCAPE] = SDLK_ESCAPE; | |
270 VK_keymap[VK_SPACE] = SDLK_SPACE; | |
271 VK_keymap[VK_APOSTROPHE] = SDLK_QUOTE; | |
272 VK_keymap[VK_COMMA] = SDLK_COMMA; | |
273 VK_keymap[VK_MINUS] = SDLK_MINUS; | |
274 VK_keymap[VK_PERIOD] = SDLK_PERIOD; | |
275 VK_keymap[VK_SLASH] = SDLK_SLASH; | |
276 VK_keymap[VK_0] = SDLK_0; | |
277 VK_keymap[VK_1] = SDLK_1; | |
278 VK_keymap[VK_2] = SDLK_2; | |
279 VK_keymap[VK_3] = SDLK_3; | |
280 VK_keymap[VK_4] = SDLK_4; | |
281 VK_keymap[VK_5] = SDLK_5; | |
282 VK_keymap[VK_6] = SDLK_6; | |
283 VK_keymap[VK_7] = SDLK_7; | |
284 VK_keymap[VK_8] = SDLK_8; | |
285 VK_keymap[VK_9] = SDLK_9; | |
286 VK_keymap[VK_SEMICOLON] = SDLK_SEMICOLON; | |
287 VK_keymap[VK_EQUALS] = SDLK_EQUALS; | |
288 VK_keymap[VK_LBRACKET] = SDLK_LEFTBRACKET; | |
289 VK_keymap[VK_BACKSLASH] = SDLK_BACKSLASH; | |
1253
7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
290 VK_keymap[VK_OEM_102] = SDLK_LESS; |
0 | 291 VK_keymap[VK_RBRACKET] = SDLK_RIGHTBRACKET; |
292 VK_keymap[VK_GRAVE] = SDLK_BACKQUOTE; | |
327
13fc64213765
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
297
diff
changeset
|
293 VK_keymap[VK_BACKTICK] = SDLK_BACKQUOTE; |
0 | 294 VK_keymap[VK_A] = SDLK_a; |
295 VK_keymap[VK_B] = SDLK_b; | |
296 VK_keymap[VK_C] = SDLK_c; | |
297 VK_keymap[VK_D] = SDLK_d; | |
298 VK_keymap[VK_E] = SDLK_e; | |
299 VK_keymap[VK_F] = SDLK_f; | |
300 VK_keymap[VK_G] = SDLK_g; | |
301 VK_keymap[VK_H] = SDLK_h; | |
302 VK_keymap[VK_I] = SDLK_i; | |
303 VK_keymap[VK_J] = SDLK_j; | |
304 VK_keymap[VK_K] = SDLK_k; | |
305 VK_keymap[VK_L] = SDLK_l; | |
306 VK_keymap[VK_M] = SDLK_m; | |
307 VK_keymap[VK_N] = SDLK_n; | |
308 VK_keymap[VK_O] = SDLK_o; | |
309 VK_keymap[VK_P] = SDLK_p; | |
310 VK_keymap[VK_Q] = SDLK_q; | |
311 VK_keymap[VK_R] = SDLK_r; | |
312 VK_keymap[VK_S] = SDLK_s; | |
313 VK_keymap[VK_T] = SDLK_t; | |
314 VK_keymap[VK_U] = SDLK_u; | |
315 VK_keymap[VK_V] = SDLK_v; | |
316 VK_keymap[VK_W] = SDLK_w; | |
317 VK_keymap[VK_X] = SDLK_x; | |
318 VK_keymap[VK_Y] = SDLK_y; | |
319 VK_keymap[VK_Z] = SDLK_z; | |
320 VK_keymap[VK_DELETE] = SDLK_DELETE; | |
321 | |
322 VK_keymap[VK_NUMPAD0] = SDLK_KP0; | |
323 VK_keymap[VK_NUMPAD1] = SDLK_KP1; | |
324 VK_keymap[VK_NUMPAD2] = SDLK_KP2; | |
325 VK_keymap[VK_NUMPAD3] = SDLK_KP3; | |
326 VK_keymap[VK_NUMPAD4] = SDLK_KP4; | |
327 VK_keymap[VK_NUMPAD5] = SDLK_KP5; | |
328 VK_keymap[VK_NUMPAD6] = SDLK_KP6; | |
329 VK_keymap[VK_NUMPAD7] = SDLK_KP7; | |
330 VK_keymap[VK_NUMPAD8] = SDLK_KP8; | |
331 VK_keymap[VK_NUMPAD9] = SDLK_KP9; | |
332 VK_keymap[VK_DECIMAL] = SDLK_KP_PERIOD; | |
333 VK_keymap[VK_DIVIDE] = SDLK_KP_DIVIDE; | |
334 VK_keymap[VK_MULTIPLY] = SDLK_KP_MULTIPLY; | |
335 VK_keymap[VK_SUBTRACT] = SDLK_KP_MINUS; | |
336 VK_keymap[VK_ADD] = SDLK_KP_PLUS; | |
337 | |
338 VK_keymap[VK_UP] = SDLK_UP; | |
339 VK_keymap[VK_DOWN] = SDLK_DOWN; | |
340 VK_keymap[VK_RIGHT] = SDLK_RIGHT; | |
341 VK_keymap[VK_LEFT] = SDLK_LEFT; | |
342 VK_keymap[VK_INSERT] = SDLK_INSERT; | |
343 VK_keymap[VK_HOME] = SDLK_HOME; | |
344 VK_keymap[VK_END] = SDLK_END; | |
345 VK_keymap[VK_PRIOR] = SDLK_PAGEUP; | |
346 VK_keymap[VK_NEXT] = SDLK_PAGEDOWN; | |
347 | |
348 VK_keymap[VK_F1] = SDLK_F1; | |
349 VK_keymap[VK_F2] = SDLK_F2; | |
350 VK_keymap[VK_F3] = SDLK_F3; | |
351 VK_keymap[VK_F4] = SDLK_F4; | |
352 VK_keymap[VK_F5] = SDLK_F5; | |
353 VK_keymap[VK_F6] = SDLK_F6; | |
354 VK_keymap[VK_F7] = SDLK_F7; | |
355 VK_keymap[VK_F8] = SDLK_F8; | |
356 VK_keymap[VK_F9] = SDLK_F9; | |
357 VK_keymap[VK_F10] = SDLK_F10; | |
358 VK_keymap[VK_F11] = SDLK_F11; | |
359 VK_keymap[VK_F12] = SDLK_F12; | |
360 VK_keymap[VK_F13] = SDLK_F13; | |
361 VK_keymap[VK_F14] = SDLK_F14; | |
362 VK_keymap[VK_F15] = SDLK_F15; | |
363 | |
364 VK_keymap[VK_NUMLOCK] = SDLK_NUMLOCK; | |
365 VK_keymap[VK_CAPITAL] = SDLK_CAPSLOCK; | |
366 VK_keymap[VK_SCROLL] = SDLK_SCROLLOCK; | |
367 VK_keymap[VK_RSHIFT] = SDLK_RSHIFT; | |
368 VK_keymap[VK_LSHIFT] = SDLK_LSHIFT; | |
369 VK_keymap[VK_RCONTROL] = SDLK_RCTRL; | |
370 VK_keymap[VK_LCONTROL] = SDLK_LCTRL; | |
371 VK_keymap[VK_RMENU] = SDLK_RALT; | |
372 VK_keymap[VK_LMENU] = SDLK_LALT; | |
373 VK_keymap[VK_RWIN] = SDLK_RSUPER; | |
374 VK_keymap[VK_LWIN] = SDLK_LSUPER; | |
375 | |
376 VK_keymap[VK_HELP] = SDLK_HELP; | |
377 #ifdef VK_PRINT | |
378 VK_keymap[VK_PRINT] = SDLK_PRINT; | |
379 #endif | |
380 VK_keymap[VK_SNAPSHOT] = SDLK_PRINT; | |
381 VK_keymap[VK_CANCEL] = SDLK_BREAK; | |
382 VK_keymap[VK_APPS] = SDLK_MENU; | |
383 } | |
384 | |
385 static SDL_keysym *TranslateKey(UINT vkey, UINT scancode, SDL_keysym *keysym, int pressed) | |
386 { | |
387 /* Set the keysym information */ | |
388 keysym->scancode = (unsigned char) scancode; | |
389 keysym->sym = VK_keymap[vkey]; | |
390 keysym->mod = KMOD_NONE; | |
391 keysym->unicode = 0; | |
1253
7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
392 if ( pressed && SDL_TranslateUNICODE ) { |
0 | 393 #ifdef NO_GETKEYBOARDSTATE |
394 /* Uh oh, better hope the vkey is close enough.. */ | |
395 keysym->unicode = vkey; | |
396 #else | |
1253
7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
397 BYTE keystate[256]; |
7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
398 Uint16 wchars[2]; |
0 | 399 |
400 GetKeyboardState(keystate); | |
1253
7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
401 if (SDL_ToUnicode(vkey, scancode, keystate, wchars, sizeof(wchars)/sizeof(wchars[0]), 0) == 1) |
7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
402 { |
7c7ddaf195bf
Implemented ToUnicode() support on Windows 95/98/ME/NT/2000/XP
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
403 keysym->unicode = wchars[0]; |
0 | 404 } |
405 #endif /* NO_GETKEYBOARDSTATE */ | |
406 } | |
407 return(keysym); | |
408 } | |
409 | |
410 int DIB_CreateWindow(_THIS) | |
411 { | |
1280
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
412 char *windowid = getenv("SDL_WINDOWID"); |
1152
51a8702d8ecd
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
Ryan C. Gordon <icculus@icculus.org>
parents:
1048
diff
changeset
|
413 |
1288
ea3888b472bf
Cleaned up the app registration stuff a bit
Sam Lantinga <slouken@libsdl.org>
parents:
1282
diff
changeset
|
414 SDL_RegisterApp(NULL, 0, 0); |
1280
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
415 |
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
416 SDL_windowid = (windowid != NULL); |
0 | 417 if ( SDL_windowid ) { |
1152
51a8702d8ecd
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
Ryan C. Gordon <icculus@icculus.org>
parents:
1048
diff
changeset
|
418 #if defined(_WIN32_WCE) && (_WIN32_WCE < 300) |
1280
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
419 /* wince 2.1 does not have strtol */ |
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
420 wchar_t *windowid_t = malloc((strlen(windowid) + 1) * sizeof(wchar_t)); |
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
421 MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, windowid, -1, windowid_t, strlen(windowid) + 1); |
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
422 SDL_Window = (HWND)wcstol(windowid_t, NULL, 0); |
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
423 free(windowid_t); |
1152
51a8702d8ecd
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
Ryan C. Gordon <icculus@icculus.org>
parents:
1048
diff
changeset
|
424 #else |
1280
f61f045343d3
Re-query the SDL_WINDOWID each time we initialize the video
Sam Lantinga <slouken@libsdl.org>
parents:
1264
diff
changeset
|
425 SDL_Window = (HWND)strtol(windowid, NULL, 0); |
1152
51a8702d8ecd
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
Ryan C. Gordon <icculus@icculus.org>
parents:
1048
diff
changeset
|
426 #endif |
974
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
427 if ( SDL_Window == NULL ) { |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
428 SDL_SetError("Couldn't get user specified window"); |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
429 return(-1); |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
430 } |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
431 |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
432 /* DJM: we want all event's for the user specified |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
433 window to be handled by SDL. |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
434 */ |
1303
52b5afd7ecee
Date: Tue, 05 Jul 2005 21:43:26 +1000
Sam Lantinga <slouken@libsdl.org>
parents:
1288
diff
changeset
|
435 userWindowProc = (WNDPROCTYPE)GetWindowLong(SDL_Window, GWL_WNDPROC); |
974
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
436 SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)WinMessage); |
0 | 437 } else { |
438 SDL_Window = CreateWindow(SDL_Appname, SDL_Appname, | |
439 (WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX), | |
833
31fa08b36380
Added support for SDL_VIDEO_WINDOW_POS and SDL_VIDEO_CENTERED on Windows
Sam Lantinga <slouken@libsdl.org>
parents:
769
diff
changeset
|
440 CW_USEDEFAULT, CW_USEDEFAULT, 0, 0, NULL, NULL, SDL_Instance, NULL); |
0 | 441 if ( SDL_Window == NULL ) { |
442 SDL_SetError("Couldn't create window"); | |
443 return(-1); | |
444 } | |
445 ShowWindow(SDL_Window, SW_HIDE); | |
446 } | |
447 return(0); | |
448 } | |
449 | |
450 void DIB_DestroyWindow(_THIS) | |
451 { | |
974
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
452 if ( SDL_windowid ) { |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
453 SetWindowLong(SDL_Window, GWL_WNDPROC, (LONG)userWindowProc); |
b8427b5151ed
Restore the user specified window proc after shutdown
Sam Lantinga <slouken@libsdl.org>
parents:
833
diff
changeset
|
454 } else { |
0 | 455 DestroyWindow(SDL_Window); |
456 } | |
1288
ea3888b472bf
Cleaned up the app registration stuff a bit
Sam Lantinga <slouken@libsdl.org>
parents:
1282
diff
changeset
|
457 SDL_UnregisterApp(); |
0 | 458 } |