annotate src/video/win32/SDL_win32video.h @ 4650:7ad7a473b086

More fixes for windows. Disabled tablet code.
author jimtla
date Thu, 10 Jun 2010 00:15:17 -0400
parents 1bceff8f008f
children 03dcb795c583
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
4426
1bceff8f008f Fixed bug #943
Sam Lantinga <slouken@libsdl.org>
parents: 3706
diff changeset
32 #undef WINVER
4650
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
33 //#define WINVER 0x500 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
34 #define WINVER 0x601 /* Need 0x600 (_WIN32_WINNT_WIN7) for WM_Touch */
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
35 #if (_WIN32_WINNT < 0x601)
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
36 #undef _WIN32_WINNT
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
37 #define _WIN32_WINNT 0x601
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
38 #endif
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
39
7ad7a473b086 More fixes for windows. Disabled tablet code.
jimtla
parents: 4426
diff changeset
40
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
41 #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
42
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
43 #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
44 //#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
45 #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
46 #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
47 #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
48
3168
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
49 #if SDL_VIDEO_RENDER_DDRAW
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
50 /* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
51 #include <objbase.h>
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
52 #include "ddraw.h"
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
53 #endif
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
54
2724
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
55 #include "wactab/wintab.h"
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
56 #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
57 #define PACKETMODE 0
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
58 #include "wactab/pktdef.h"
0e2b65f32298 Added Wacom API headers.
Sam Lantinga <slouken@libsdl.org>
parents: 2308
diff changeset
59
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
60 #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
61 #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
62 #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
63 #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
64 #include "SDL_win32mouse.h"
1913
83420da906a5 Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents: 1901
diff changeset
65 #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
66 #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
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 #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
69 #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
70 #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
71 #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
72 #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
73 #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
74 #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
75
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
76 /* 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
77
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
78 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
79 {
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
80 #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
81 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
82 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
83 #endif
3168
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
84 #if SDL_VIDEO_RENDER_DDRAW
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
85 HANDLE ddrawDLL;
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
86 IDirectDraw *ddraw;
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
87 #endif
Sam Lantinga <slouken@libsdl.org>
parents: 2974
diff changeset
88
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
89 /* *INDENT-OFF* */
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
90 /* Function pointers for the Wacom API */
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
91 HANDLE wintabDLL;
2728
2768bd7281e0 Fixed Visual Studio compilation problems
Sam Lantinga <slouken@libsdl.org>
parents: 2726
diff changeset
92 UINT (*WTInfoA) (UINT, UINT, LPVOID);
2768bd7281e0 Fixed Visual Studio compilation problems
Sam Lantinga <slouken@libsdl.org>
parents: 2726
diff changeset
93 HCTX (*WTOpenA) (HWND, LPLOGCONTEXTA, BOOL);
2726
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
94 int (*WTPacket) (HCTX, UINT, LPVOID);
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
95 BOOL (*WTClose) (HCTX);
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
96 /* *INDENT-ON* */
f23ebf1ddac4 Dynamically load wintab32.dll
Sam Lantinga <slouken@libsdl.org>
parents: 2724
diff changeset
97
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 int keyboard;
3196
413672b09bb3 Fixed some compile errors and warnings under Visual C++
Sam Lantinga <slouken@libsdl.org>
parents: 3168
diff changeset
99 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
100 } 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
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 #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
103
c121d94672cb SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
104 /* vi: set ts=4 sw=4 expandtab: */