annotate src/video/win32/SDL_win32video.h @ 3706:9676307d93be

Make sure STRICT is defined so the window proc has the correct prototype
author Sam Lantinga <slouken@libsdl.org>
date Sun, 14 Feb 2010 15:55:10 +0000
parents f7b03b6838cb
children 1bceff8f008f
rev   line source
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
1 /*
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
2 SDL - Simple DirectMedia Layer
3697
f7b03b6838cb Fixed bug #926
Sam Lantinga <slouken@libsdl.org>
parents: 3196
diff changeset
3 Copyright (C) 1997-2010 Sam Lantinga
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
4
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
5 This library is free software; you can redistribute it and/or
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
6 modify it under the terms of the GNU Lesser General Public
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
7 License as published by the Free Software Foundation; either
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
8 version 2.1 of the License, or (at your option) any later version.
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
9
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
10 This library is distributed in the hope that it will be useful,
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
13 Lesser General Public License for more details.
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
14
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
15 You should have received a copy of the GNU Lesser General Public
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
16 License along with this library; if not, write to the Free Software
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
18
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
19 Sam Lantinga
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
20 slouken@libsdl.org
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
21 */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
22 #include "SDL_config.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
23
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
24 #ifndef _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
25 #define _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
26
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
27 #include "../SDL_sysvideo.h"
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
28
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
29 #define WIN32_LEAN_AND_MEAN
3706
9676307d93be Make sure STRICT is defined so the window proc has the correct prototype
Sam Lantinga <slouken@libsdl.org>
parents: 3697
diff changeset
30 #define STRICT
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
31 #define UNICODE
c121d94672cb 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 #define WINVER 0x500 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
33 #include <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
34
c121d94672cb 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 #if SDL_VIDEO_RENDER_D3D
1901
f1828a500391 Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
36 //#include <d3d9.h>
f1828a500391 Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
37 #define D3D_DEBUG_INFO
f1828a500391 Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
38 #include "d3d9.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
39 #endif
c121d94672cb 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
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
41 #if SDL_VIDEO_RENDER_DDRAW
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
42 /* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
43 #include <objbase.h>
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
44 #include "ddraw.h"
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
45 #endif
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
46
2724
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
47 #include "wactab/wintab.h"
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
48 #define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
49 #define PACKETMODE 0
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
50 #include "wactab/pktdef.h"
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
51
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
52 #include "SDL_win32events.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
53 #include "SDL_win32gamma.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
54 #include "SDL_win32keyboard.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
55 #include "SDL_win32modes.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
56 #include "SDL_win32mouse.h"
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1901
diff changeset
57 #include "SDL_win32opengl.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
58 #include "SDL_win32window.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
59
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
60 #ifdef UNICODE
1901
f1828a500391 Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
61 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
1895
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
62 #define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)S, SDL_strlen(S)+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
63 #else
1901
f1828a500391 Removed libc dependency on Windows again, to fix building with Visual C++ 2005 Express Edition.
Sam Lantinga <slouken@libsdl.org>
parents: 1895
diff changeset
64 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
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
65 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+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
66 #endif
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
67
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
68 /* Private display 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
69
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
70 typedef struct SDL_VideoData
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
71 {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
72 #if SDL_VIDEO_RENDER_D3D
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
73 HANDLE d3dDLL;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
74 IDirect3D9 *d3d;
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
75 #endif
3168
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
76 #if SDL_VIDEO_RENDER_DDRAW
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
77 HANDLE ddrawDLL;
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
78 IDirectDraw *ddraw;
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
79 #endif
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
80
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
81 /* *INDENT-OFF* */
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
82 /* Function pointers for the Wacom API */
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
83 HANDLE wintabDLL;
2728
2768bd7281e0 Fixed Visual Studio compilation problems
Sam Lantinga <slouken@libsdl.org>
parents: 2726
diff changeset
84 UINT (*WTInfoA) (UINT, UINT, LPVOID);
2768bd7281e0 Fixed Visual Studio compilation problems
Sam Lantinga <slouken@libsdl.org>
parents: 2726
diff changeset
85 HCTX (*WTOpenA) (HWND, LPLOGCONTEXTA, BOOL);
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
86 int (*WTPacket) (HCTX, UINT, LPVOID);
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
87 BOOL (*WTClose) (HCTX);
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
88 /* *INDENT-ON* */
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
89
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
90 int keyboard;
3196
413672b09bb3 Fixed some compile errors and warnings under Visual C++
Sam Lantinga <slouken@libsdl.org>
parents: 3168
diff changeset
91 const SDL_scancode *key_layout;
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
92 } SDL_VideoData;
c121d94672cb 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
c121d94672cb 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 #endif /* _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
95
c121d94672cb 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 /* vi: set ts=4 sw=4 expandtab: */