4755
|
1 /*
|
|
2 SDL - Simple DirectMedia Layer
|
|
3 Copyright (C) 1997-2010 Sam Lantinga
|
|
4
|
|
5 This library is free software; you can redistribute it and/or
|
|
6 modify it under the terms of the GNU Lesser General Public
|
|
7 License as published by the Free Software Foundation; either
|
|
8 version 2.1 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 Lesser General Public License for more details.
|
|
14
|
|
15 You should have received a copy of the GNU Lesser General Public
|
|
16 License along with this library; if not, write to the Free Software
|
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
18
|
|
19 Sam Lantinga
|
|
20 slouken@libsdl.org
|
|
21 */
|
|
22 #include "SDL_config.h"
|
|
23
|
|
24 #ifndef _SDL_win32video_h
|
|
25 #define _SDL_win32video_h
|
|
26
|
|
27 #include "../SDL_sysvideo.h"
|
|
28
|
|
29 #define WIN32_LEAN_AND_MEAN
|
|
30 #define STRICT
|
|
31 #define UNICODE
|
|
32 #undef WINVER
|
|
33 #define WINVER 0x500 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices() */
|
|
34 #include <windows.h>
|
|
35
|
|
36 #if SDL_VIDEO_RENDER_D3D
|
|
37 //#include <d3d9.h>
|
|
38 #define D3D_DEBUG_INFO
|
|
39 #include "d3d9.h"
|
|
40 #endif
|
|
41
|
|
42 #if SDL_VIDEO_RENDER_DDRAW
|
|
43 /* WIN32_LEAN_AND_MEAN was defined, so we have to include this by hand */
|
|
44 #include <objbase.h>
|
|
45 #include "ddraw.h"
|
|
46 #endif
|
|
47
|
|
48 #include "SDL_win32clipboard.h"
|
|
49 #include "SDL_win32events.h"
|
|
50 #include "SDL_win32gamma.h"
|
|
51 #include "SDL_win32keyboard.h"
|
|
52 #include "SDL_win32modes.h"
|
|
53 #include "SDL_win32mouse.h"
|
|
54 #include "SDL_win32opengl.h"
|
|
55 #include "SDL_win32window.h"
|
|
56
|
|
57 #ifdef UNICODE
|
|
58 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2", (char *)S, (SDL_wcslen(S)+1)*sizeof(WCHAR))
|
|
59 #define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2", "UTF-8", (char *)S, SDL_strlen(S)+1)
|
|
60 #else
|
|
61 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)S, (SDL_strlen(S)+1))
|
|
62 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)S, SDL_strlen(S)+1)
|
|
63 #endif
|
|
64 extern void WIN_SetError(const char *prefix);
|
|
65
|
|
66 /* Private display data */
|
|
67
|
|
68 typedef struct SDL_VideoData
|
|
69 {
|
|
70 #if SDL_VIDEO_RENDER_D3D
|
|
71 HANDLE d3dDLL;
|
|
72 IDirect3D9 *d3d;
|
|
73 #endif
|
|
74 #if SDL_VIDEO_RENDER_DDRAW
|
|
75 HANDLE ddrawDLL;
|
|
76 IDirectDraw *ddraw;
|
|
77 #endif
|
|
78
|
|
79 const SDL_scancode *key_layout;
|
|
80 DWORD clipboard_count;
|
|
81
|
|
82 SDL_bool ime_com_initialized;
|
|
83 struct ITfThreadMgr *ime_thread_mgr;
|
|
84 SDL_bool ime_initialized;
|
|
85 SDL_bool ime_enabled;
|
|
86 SDL_bool ime_available;
|
|
87 HWND ime_hwnd_main;
|
|
88 HWND ime_hwnd_current;
|
|
89 HIMC ime_himc;
|
|
90
|
|
91 } SDL_VideoData;
|
|
92
|
|
93 #endif /* _SDL_win32video_h */
|
|
94
|
|
95 /* vi: set ts=4 sw=4 expandtab: */
|