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