src/audio/directsound/directx.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 14 Jul 2013 18:17:28 -0700
changeset 7523 9e9ab1dc3811
parent 7191 75360622e65f
child 8616 ec011c16e2fd
permissions -rw-r--r--
Fixed bug 1919 - Window icon disappears as soon as a renderer is created

Sebastian

Setting a window icon works just fine until a renderer is added to the window.
After adding the renderer the icon disappears.

Reproduce by:
- Take the example code from the wiki: http://wiki.libsdl.org/moin.fcg/SDL_SetWindowIcon

- Add the following two lines after SDL_FreeSurface(surface);
SDL_Delay(1000);
SDL_Renderer* ren = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED);

-compile and run

You will see the window icon correctly at first. After the Delay the Icon will disappear.
slouken@1274
     1
slouken@1274
     2
#ifndef _directx_h
slouken@1274
     3
#define _directx_h
slouken@1274
     4
icculus@5587
     5
/* Include all of the DirectX 8.0 headers and adds any necessary tweaks */
slouken@1274
     6
slouken@5090
     7
#include "../../core/windows/SDL_windows.h"
slouken@1274
     8
#include <mmsystem.h>
slouken@1274
     9
#ifndef WIN32
slouken@1274
    10
#define WIN32
slouken@1274
    11
#endif
slouken@1274
    12
#undef  WINNT
slouken@1274
    13
slouken@1274
    14
/* Far pointers don't exist in 32-bit code */
slouken@1274
    15
#ifndef FAR
slouken@1274
    16
#define FAR
slouken@1274
    17
#endif
slouken@1274
    18
slouken@1274
    19
/* Error codes not yet included in Win32 API header files */
slouken@1274
    20
#ifndef MAKE_HRESULT
slouken@1274
    21
#define MAKE_HRESULT(sev,fac,code) \
slouken@7191
    22
    ((HRESULT)(((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))))
slouken@1274
    23
#endif
slouken@1274
    24
slouken@1274
    25
#ifndef S_OK
slouken@7191
    26
#define S_OK        (HRESULT)0x00000000L
slouken@1274
    27
#endif
slouken@1274
    28
slouken@1274
    29
#ifndef SUCCEEDED
slouken@7191
    30
#define SUCCEEDED(x)    ((HRESULT)(x) >= 0)
slouken@1274
    31
#endif
slouken@1274
    32
#ifndef FAILED
slouken@7191
    33
#define FAILED(x)   ((HRESULT)(x)<0)
slouken@1274
    34
#endif
slouken@1274
    35
slouken@1274
    36
#ifndef E_FAIL
slouken@7191
    37
#define E_FAIL      (HRESULT)0x80000008L
slouken@1274
    38
#endif
slouken@1274
    39
#ifndef E_NOINTERFACE
slouken@7191
    40
#define E_NOINTERFACE   (HRESULT)0x80004002L
slouken@1274
    41
#endif
slouken@1274
    42
#ifndef E_OUTOFMEMORY
slouken@7191
    43
#define E_OUTOFMEMORY   (HRESULT)0x8007000EL
slouken@1274
    44
#endif
slouken@1274
    45
#ifndef E_INVALIDARG
slouken@7191
    46
#define E_INVALIDARG    (HRESULT)0x80070057L
slouken@1274
    47
#endif
slouken@1274
    48
#ifndef E_NOTIMPL
slouken@7191
    49
#define E_NOTIMPL   (HRESULT)0x80004001L
slouken@1274
    50
#endif
slouken@1274
    51
#ifndef REGDB_E_CLASSNOTREG
slouken@7191
    52
#define REGDB_E_CLASSNOTREG (HRESULT)0x80040154L
slouken@1274
    53
#endif
slouken@1274
    54
slouken@1274
    55
/* Severity codes */
slouken@1274
    56
#ifndef SEVERITY_ERROR
slouken@7191
    57
#define SEVERITY_ERROR  1
slouken@1274
    58
#endif
slouken@1274
    59
slouken@1274
    60
/* Error facility codes */
slouken@1274
    61
#ifndef FACILITY_WIN32
slouken@7191
    62
#define FACILITY_WIN32  7
slouken@1274
    63
#endif
slouken@1274
    64
slouken@1274
    65
#ifndef FIELD_OFFSET
slouken@1274
    66
#define FIELD_OFFSET(type, field)    ((LONG)&(((type *)0)->field))
slouken@1274
    67
#endif
slouken@1274
    68
slouken@1274
    69
/* DirectX headers (if it isn't included, I haven't tested it yet)
slouken@1274
    70
 */
slouken@1274
    71
/* We need these defines to mark what version of DirectX API we use */
slouken@1274
    72
#define DIRECTDRAW_VERSION  0x0700
icculus@5587
    73
#define DIRECTSOUND_VERSION 0x0800
slouken@1274
    74
#define DIRECTINPUT_VERSION 0x0500
slouken@1274
    75
slouken@1274
    76
#include <ddraw.h>
slouken@1274
    77
#include <dsound.h>
slouken@1274
    78
#include <dinput.h>
slouken@1274
    79
slouken@1274
    80
#endif /* _directx_h */
slouken@1895
    81
/* vi: set ts=4 sw=4 expandtab: */