src/audio/SDL_wave.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 14 Jul 2013 18:17:28 -0700
changeset 7523 9e9ab1dc3811
parent 7191 75360622e65f
child 8093 b43765095a6f
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.
     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 #include "SDL_config.h"
    22 
    23 /* WAVE files are little-endian */
    24 
    25 /*******************************************/
    26 /* Define values for Microsoft WAVE format */
    27 /*******************************************/
    28 #define RIFF            0x46464952      /* "RIFF" */
    29 #define WAVE            0x45564157      /* "WAVE" */
    30 #define FACT            0x74636166      /* "fact" */
    31 #define LIST            0x5453494c      /* "LIST" */
    32 #define FMT             0x20746D66      /* "fmt " */
    33 #define DATA            0x61746164      /* "data" */
    34 #define PCM_CODE        0x0001
    35 #define MS_ADPCM_CODE   0x0002
    36 #define IEEE_FLOAT_CODE 0x0003
    37 #define IMA_ADPCM_CODE  0x0011
    38 #define MP3_CODE        0x0055
    39 #define WAVE_MONO       1
    40 #define WAVE_STEREO     2
    41 
    42 /* Normally, these three chunks come consecutively in a WAVE file */
    43 typedef struct WaveFMT
    44 {
    45 /* Not saved in the chunk we read:
    46     Uint32  FMTchunk;
    47     Uint32  fmtlen;
    48 */
    49     Uint16 encoding;
    50     Uint16 channels;            /* 1 = mono, 2 = stereo */
    51     Uint32 frequency;           /* One of 11025, 22050, or 44100 Hz */
    52     Uint32 byterate;            /* Average bytes per second */
    53     Uint16 blockalign;          /* Bytes per sample block */
    54     Uint16 bitspersample;       /* One of 8, 12, 16, or 4 for ADPCM */
    55 } WaveFMT;
    56 
    57 /* The general chunk found in the WAVE file */
    58 typedef struct Chunk
    59 {
    60     Uint32 magic;
    61     Uint32 length;
    62     Uint8 *data;
    63 } Chunk;
    64 
    65 /* vi: set ts=4 sw=4 expandtab: */