src/events/default_cursor.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 22 Jun 2015 23:36:06 -0700
changeset 9776 952ff8a5076f
parent 9709 cc44b8a34b2d
child 10000 acd714e378f4
permissions -rw-r--r--
Fixed bug 3030 - SDL_RecreateWindow fails to restore title, icon, etc.

Adam M.

It loses the title and icon when window recreation fails. For instance, this may happen when trying to create an OpenGL ES window on a system that doesn't support it. But at that point, the title and icon have already been lost.
slouken@1895
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@9619
     3
  Copyright (C) 1997-2015 Sam Lantinga <slouken@libsdl.org>
slouken@1895
     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@1895
     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@1895
    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@1895
    20
*/
slouken@1895
    21
slouken@7191
    22
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
slouken@1895
    23
 * Default cursor - it happens to be the Mac cursor, but could be anything   */
slouken@1895
    24
slouken@7191
    25
#define DEFAULT_CWIDTH  16
slouken@7191
    26
#define DEFAULT_CHEIGHT 16
slouken@7191
    27
#define DEFAULT_CHOTX   0
slouken@7191
    28
#define DEFAULT_CHOTY   0
slouken@1895
    29
slouken@1895
    30
/* Added a real MacOS cursor, at the request of Luc-Olivier de Charrière */
slouken@1895
    31
#define USE_MACOS_CURSOR
slouken@1895
    32
slouken@1895
    33
#ifdef USE_MACOS_CURSOR
slouken@1895
    34
slouken@3162
    35
static const unsigned char default_cdata[] = {
slouken@1895
    36
    0x00, 0x00,
slouken@1895
    37
    0x40, 0x00,
slouken@1895
    38
    0x60, 0x00,
slouken@1895
    39
    0x70, 0x00,
slouken@1895
    40
    0x78, 0x00,
slouken@1895
    41
    0x7C, 0x00,
slouken@1895
    42
    0x7E, 0x00,
slouken@1895
    43
    0x7F, 0x00,
slouken@1895
    44
    0x7F, 0x80,
slouken@1895
    45
    0x7C, 0x00,
slouken@1895
    46
    0x6C, 0x00,
slouken@1895
    47
    0x46, 0x00,
slouken@1895
    48
    0x06, 0x00,
slouken@1895
    49
    0x03, 0x00,
slouken@1895
    50
    0x03, 0x00,
slouken@1895
    51
    0x00, 0x00
slouken@1895
    52
};
slouken@2735
    53
slouken@3162
    54
static const unsigned char default_cmask[] = {
slouken@1895
    55
    0xC0, 0x00,
slouken@1895
    56
    0xE0, 0x00,
slouken@1895
    57
    0xF0, 0x00,
slouken@1895
    58
    0xF8, 0x00,
slouken@1895
    59
    0xFC, 0x00,
slouken@1895
    60
    0xFE, 0x00,
slouken@1895
    61
    0xFF, 0x00,
slouken@1895
    62
    0xFF, 0x80,
slouken@1895
    63
    0xFF, 0xC0,
slouken@1895
    64
    0xFF, 0xE0,
slouken@1895
    65
    0xFE, 0x00,
slouken@1895
    66
    0xEF, 0x00,
slouken@1895
    67
    0xCF, 0x00,
slouken@1895
    68
    0x87, 0x80,
slouken@1895
    69
    0x07, 0x80,
slouken@1895
    70
    0x03, 0x00
slouken@1895
    71
};
slouken@1895
    72
slouken@1895
    73
#else
slouken@1895
    74
slouken@3162
    75
static const unsigned char default_cdata[] = {
slouken@1895
    76
    0x00, 0x00,
slouken@1895
    77
    0x40, 0x00,
slouken@1895
    78
    0x60, 0x00,
slouken@1895
    79
    0x70, 0x00,
slouken@1895
    80
    0x78, 0x00,
slouken@1895
    81
    0x7C, 0x00,
slouken@1895
    82
    0x7E, 0x00,
slouken@1895
    83
    0x7F, 0x00,
slouken@1895
    84
    0x7F, 0x80,
slouken@1895
    85
    0x7C, 0x00,
slouken@1895
    86
    0x6C, 0x00,
slouken@1895
    87
    0x46, 0x00,
slouken@1895
    88
    0x06, 0x00,
slouken@1895
    89
    0x03, 0x00,
slouken@1895
    90
    0x03, 0x00,
slouken@1895
    91
    0x00, 0x00
slouken@1895
    92
};
slouken@2735
    93
slouken@3162
    94
static const unsigned char default_cmask[] = {
slouken@1895
    95
    0x40, 0x00,
slouken@1895
    96
    0xE0, 0x00,
slouken@1895
    97
    0xF0, 0x00,
slouken@1895
    98
    0xF8, 0x00,
slouken@1895
    99
    0xFC, 0x00,
slouken@1895
   100
    0xFE, 0x00,
slouken@1895
   101
    0xFF, 0x00,
slouken@1895
   102
    0xFF, 0x80,
slouken@1895
   103
    0xFF, 0xC0,
slouken@1895
   104
    0xFF, 0x80,
slouken@1895
   105
    0xFE, 0x00,
slouken@1895
   106
    0xEF, 0x00,
slouken@1895
   107
    0x4F, 0x00,
slouken@1895
   108
    0x07, 0x80,
slouken@1895
   109
    0x07, 0x80,
slouken@1895
   110
    0x03, 0x00
slouken@1895
   111
};
slouken@1895
   112
philipp@9709
   113
#endif /* USE_MACOS_CURSOR */
slouken@1895
   114
/* vi: set ts=4 sw=4 expandtab: */