src/core/windows/SDL_windows.h
author Philipp Wiesemann
Thu, 30 May 2013 12:23:36 +0200
changeset 7242 96f4133dfafa
parent 7037 3fedf1f25b94
child 7660 78204ab75b0f
child 8460 f483e8bdae3c
permissions -rw-r--r--
Added deactivated loading of SDL2_net to Java file.
slouken@5090
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@6885
     3
  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
slouken@5090
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@5090
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@5090
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@5090
    20
*/
slouken@5090
    21
slouken@5090
    22
/* This is an include file for windows.h with the SDL build settings */
slouken@5090
    23
slouken@5090
    24
#ifndef _INCLUDED_WINDOWS_H
slouken@5090
    25
#define _INCLUDED_WINDOWS_H
slouken@5090
    26
slouken@5090
    27
#define WIN32_LEAN_AND_MEAN
slouken@5090
    28
#define STRICT
slouken@5090
    29
#ifndef UNICODE
slouken@5090
    30
#define UNICODE 1
slouken@5090
    31
#endif
slouken@5336
    32
#undef _WIN32_WINNT
slouken@6350
    33
#define _WIN32_WINNT  0x501   /* Need 0x410 for AlphaBlend() and 0x500 for EnumDisplayDevices(), 0x501 for raw input */
slouken@5090
    34
slouken@5090
    35
#include <windows.h>
slouken@5090
    36
slouken@5090
    37
/* Routines to convert from UTF8 to native Windows text */
slouken@5090
    38
#if UNICODE
slouken@6612
    39
#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "UCS-2-INTERNAL", (char *)(S), (SDL_wcslen(S)+1)*sizeof(WCHAR))
slouken@6612
    40
#define WIN_UTF8ToString(S) (WCHAR *)SDL_iconv_string("UCS-2-INTERNAL", "UTF-8", (char *)(S), SDL_strlen(S)+1)
slouken@5090
    41
#else
slouken@5090
    42
#define WIN_StringToUTF8(S) SDL_iconv_string("UTF-8", "ASCII", (char *)(S), (SDL_strlen(S)+1))
slouken@5090
    43
#define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)
slouken@5090
    44
#endif
slouken@5090
    45
icculus@7037
    46
/* Sets an error message based on GetLastError(). Always return -1. */
icculus@7037
    47
extern int WIN_SetError(const char *prefix);
slouken@5090
    48
icculus@5591
    49
/* Wrap up the oddities of CoInitialize() into a common function. */
icculus@5591
    50
extern HRESULT WIN_CoInitialize(void);
icculus@5591
    51
extern void WIN_CoUninitialize(void);
icculus@5591
    52
slouken@5090
    53
#endif /* _INCLUDED_WINDOWS_H */
slouken@5090
    54
slouken@5090
    55
/* vi: set ts=4 sw=4 expandtab: */