zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_windows.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 /* This is an include file for windows.h with the SDL build settings */
23 
24 #ifndef _INCLUDED_WINDOWS_H
25 #define _INCLUDED_WINDOWS_H
26 
27 #define WIN32_LEAN_AND_MEAN
28 #define STRICT
29 #ifndef UNICODE
30 #define UNICODE 1
31 #endif
32 #undef _WIN32_WINNT
33 #define _WIN32_WINNT 0x501 /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */
34 
35 #include <windows.h>
36 
37 /* Routines to convert from UTF8 to native Windows text */
38 /* !!! FIXME: should we force Unicode at this point? */
39 #if UNICODE
40 /* !!! FIXME: UCS-2 should be UTF-16 on Windows. */
41 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
42 #define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", (char *)(S), SDL_strlen(S)+1)
43 #else
44 /* !!! FIXME: UTF8ToString() can just be a SDL_strdup() here. */
45 #define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
46 #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)
47 #endif
48 
49 /* Sets an error message based on GetLastError(). Always return -1. */
50 extern int WIN_SetError(const char *prefix);
51 
52 /* Wrap up the oddities of CoInitialize() into a common function. */
53 extern HRESULT WIN_CoInitialize(void);
54 extern void WIN_CoUninitialize(void);
55 
56 #endif /* _INCLUDED_WINDOWS_H */
57 
58 /* vi: set ts=4 sw=4 expandtab: */
typedef HRESULT(WINAPI *LPD3DXIMTSIGNALCALLBACK)(CONST D3DXVECTOR2 *uv
HRESULT WIN_CoInitialize(void)
void WIN_CoUninitialize(void)
int WIN_SetError(const char *prefix)