ruby2d 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/README.md +20 -7
- data/assets/include/SDL2/SDL.h +135 -0
- data/assets/include/SDL2/SDL_assert.h +291 -0
- data/assets/include/SDL2/SDL_atomic.h +277 -0
- data/assets/include/SDL2/SDL_audio.h +826 -0
- data/assets/include/SDL2/SDL_bits.h +112 -0
- data/assets/include/SDL2/SDL_blendmode.h +120 -0
- data/assets/include/SDL2/SDL_clipboard.h +71 -0
- data/assets/include/SDL2/SDL_config.h +421 -0
- data/assets/include/SDL2/SDL_cpuinfo.h +188 -0
- data/assets/include/SDL2/SDL_egl.h +1673 -0
- data/assets/include/SDL2/SDL_endian.h +260 -0
- data/assets/include/SDL2/SDL_error.h +76 -0
- data/assets/include/SDL2/SDL_events.h +788 -0
- data/assets/include/SDL2/SDL_filesystem.h +136 -0
- data/assets/include/SDL2/SDL_gamecontroller.h +390 -0
- data/assets/include/SDL2/SDL_gesture.h +87 -0
- data/assets/include/SDL2/SDL_haptic.h +1238 -0
- data/assets/include/SDL2/SDL_hints.h +1135 -0
- data/assets/include/SDL2/SDL_image.h +161 -0
- data/assets/include/SDL2/SDL_joystick.h +408 -0
- data/assets/include/SDL2/SDL_keyboard.h +217 -0
- data/assets/include/SDL2/SDL_keycode.h +349 -0
- data/assets/include/SDL2/SDL_loadso.h +81 -0
- data/assets/include/SDL2/SDL_log.h +211 -0
- data/assets/include/SDL2/SDL_main.h +168 -0
- data/assets/include/SDL2/SDL_messagebox.h +144 -0
- data/assets/include/SDL2/SDL_mixer.h +651 -0
- data/assets/include/SDL2/SDL_mouse.h +302 -0
- data/assets/include/SDL2/SDL_mutex.h +251 -0
- data/assets/include/SDL2/SDL_name.h +33 -0
- data/assets/include/SDL2/SDL_opengl.h +2183 -0
- data/assets/include/SDL2/SDL_opengl_glext.h +11177 -0
- data/assets/include/SDL2/SDL_opengles.h +39 -0
- data/assets/include/SDL2/SDL_opengles2.h +52 -0
- data/assets/include/SDL2/SDL_opengles2_gl2.h +621 -0
- data/assets/include/SDL2/SDL_opengles2_gl2ext.h +2050 -0
- data/assets/include/SDL2/SDL_opengles2_gl2platform.h +30 -0
- data/assets/include/SDL2/SDL_opengles2_khrplatform.h +282 -0
- data/assets/include/SDL2/SDL_pixels.h +470 -0
- data/assets/include/SDL2/SDL_platform.h +198 -0
- data/assets/include/SDL2/SDL_power.h +75 -0
- data/assets/include/SDL2/SDL_quit.h +58 -0
- data/assets/include/SDL2/SDL_rect.h +148 -0
- data/assets/include/SDL2/SDL_render.h +931 -0
- data/assets/include/SDL2/SDL_revision.h +2 -0
- data/assets/include/SDL2/SDL_rwops.h +254 -0
- data/assets/include/SDL2/SDL_scancode.h +413 -0
- data/assets/include/SDL2/SDL_sensor.h +251 -0
- data/assets/include/SDL2/SDL_shape.h +144 -0
- data/assets/include/SDL2/SDL_stdinc.h +607 -0
- data/assets/include/SDL2/SDL_surface.h +553 -0
- data/assets/include/SDL2/SDL_system.h +279 -0
- data/assets/include/SDL2/SDL_syswm.h +324 -0
- data/assets/include/SDL2/SDL_test.h +69 -0
- data/assets/include/SDL2/SDL_test_assert.h +105 -0
- data/assets/include/SDL2/SDL_test_common.h +188 -0
- data/assets/include/SDL2/SDL_test_compare.h +69 -0
- data/assets/include/SDL2/SDL_test_crc32.h +124 -0
- data/assets/include/SDL2/SDL_test_font.h +81 -0
- data/assets/include/SDL2/SDL_test_fuzzer.h +384 -0
- data/assets/include/SDL2/SDL_test_harness.h +134 -0
- data/assets/include/SDL2/SDL_test_images.h +78 -0
- data/assets/include/SDL2/SDL_test_log.h +67 -0
- data/assets/include/SDL2/SDL_test_md5.h +129 -0
- data/assets/include/SDL2/SDL_test_memory.h +63 -0
- data/assets/include/SDL2/SDL_test_random.h +115 -0
- data/assets/include/SDL2/SDL_thread.h +343 -0
- data/assets/include/SDL2/SDL_timer.h +115 -0
- data/assets/include/SDL2/SDL_touch.h +86 -0
- data/assets/include/SDL2/SDL_ttf.h +294 -0
- data/assets/include/SDL2/SDL_types.h +29 -0
- data/assets/include/SDL2/SDL_version.h +162 -0
- data/assets/include/SDL2/SDL_video.h +1276 -0
- data/assets/include/SDL2/SDL_vulkan.h +278 -0
- data/assets/include/SDL2/begin_code.h +167 -0
- data/assets/include/SDL2/close_code.h +37 -0
- data/assets/include/glew.h +23686 -0
- data/assets/include/simple2d.h +735 -0
- data/assets/ios/MRuby.framework/Headers/mrbconf.h +3 -5
- data/assets/ios/MRuby.framework/Headers/mruby.h +35 -32
- data/assets/ios/MRuby.framework/Headers/mruby/array.h +1 -0
- data/assets/ios/MRuby.framework/Headers/mruby/boxing_word.h +9 -1
- data/assets/ios/MRuby.framework/Headers/mruby/class.h +14 -11
- data/assets/ios/MRuby.framework/Headers/mruby/common.h +5 -0
- data/assets/ios/MRuby.framework/Headers/mruby/compile.h +4 -3
- data/assets/ios/MRuby.framework/Headers/mruby/debug.h +3 -2
- data/assets/ios/MRuby.framework/Headers/mruby/dump.h +2 -2
- data/assets/ios/MRuby.framework/Headers/mruby/hash.h +38 -5
- data/assets/ios/MRuby.framework/Headers/mruby/irep.h +17 -4
- data/assets/ios/MRuby.framework/Headers/mruby/object.h +4 -5
- data/assets/ios/MRuby.framework/Headers/mruby/opcode.h +47 -139
- data/assets/ios/MRuby.framework/Headers/mruby/ops.h +117 -0
- data/assets/ios/MRuby.framework/Headers/mruby/proc.h +4 -4
- data/assets/ios/MRuby.framework/Headers/mruby/string.h +11 -7
- data/assets/ios/MRuby.framework/Headers/mruby/throw.h +4 -4
- data/assets/ios/MRuby.framework/Headers/mruby/variable.h +2 -4
- data/assets/ios/MRuby.framework/Headers/mruby/version.h +6 -6
- data/assets/ios/MRuby.framework/MRuby +0 -0
- data/assets/ios/MyApp.xcodeproj/project.pbxproj +24 -18
- data/assets/ios/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/assets/ios/main.c +1 -1
- data/assets/macos/lib/libFLAC.a +0 -0
- data/assets/macos/lib/libSDL2.a +0 -0
- data/assets/macos/lib/libSDL2_image.a +0 -0
- data/assets/macos/lib/libSDL2_mixer.a +0 -0
- data/assets/macos/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/lib/libfreetype.a +0 -0
- data/assets/macos/lib/libjpeg.a +0 -0
- data/assets/macos/lib/libmpg123.a +0 -0
- data/assets/macos/lib/libogg.a +0 -0
- data/assets/macos/lib/libpng16.a +0 -0
- data/assets/macos/lib/libsimple2d.a +0 -0
- data/assets/macos/lib/libtiff.a +0 -0
- data/assets/macos/lib/libvorbis.a +0 -0
- data/assets/macos/lib/libvorbisfile.a +0 -0
- data/assets/macos/lib/libwebp.a +0 -0
- data/assets/mingw/bin/SDL2.dll +0 -0
- data/assets/mingw/bin/SDL2_image.dll +0 -0
- data/assets/mingw/bin/SDL2_mixer.dll +0 -0
- data/assets/mingw/bin/SDL2_ttf.dll +0 -0
- data/assets/mingw/bin/glew32.dll +0 -0
- data/assets/mingw/bin/libFLAC-8.dll +0 -0
- data/assets/mingw/bin/libfreetype-6.dll +0 -0
- data/assets/mingw/bin/libjpeg-9.dll +0 -0
- data/assets/mingw/bin/libmodplug-1.dll +0 -0
- data/assets/mingw/bin/libmpg123-0.dll +0 -0
- data/assets/mingw/bin/libogg-0.dll +0 -0
- data/assets/mingw/bin/libopus-0.dll +0 -0
- data/assets/mingw/bin/libopusfile-0.dll +0 -0
- data/assets/mingw/bin/libpng16-16.dll +0 -0
- data/assets/mingw/bin/libtiff-5.dll +0 -0
- data/assets/mingw/bin/libvorbis-0.dll +0 -0
- data/assets/mingw/bin/libvorbisfile-3.dll +0 -0
- data/assets/mingw/bin/libwebp-7.dll +0 -0
- data/assets/mingw/bin/zlib1.dll +0 -0
- data/assets/mingw/lib/libSDL2.a +0 -0
- data/assets/mingw/lib/libSDL2.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_image.a +0 -0
- data/assets/mingw/lib/libSDL2_image.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.a +0 -0
- data/assets/mingw/lib/libSDL2_mixer.dll.a +0 -0
- data/assets/mingw/lib/libSDL2_test.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.a +0 -0
- data/assets/mingw/lib/libSDL2_ttf.dll.a +0 -0
- data/assets/mingw/lib/libSDL2main.a +0 -0
- data/assets/mingw/lib/libglew32.a +0 -0
- data/assets/mingw/lib/libglew32.dll.a +0 -0
- data/assets/mingw/lib/libsimple2d.a +0 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Large.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Back.imagestacklayer/Content.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Front.imagestacklayer/Content.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - Small.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json +4 -0
- data/assets/tvos/Assets.xcassets/LaunchImage.launchimage/Contents.json +7 -0
- data/assets/tvos/MRuby.framework/Headers/mrbconf.h +3 -5
- data/assets/tvos/MRuby.framework/Headers/mruby.h +35 -32
- data/assets/tvos/MRuby.framework/Headers/mruby/array.h +1 -0
- data/assets/tvos/MRuby.framework/Headers/mruby/boxing_word.h +9 -1
- data/assets/tvos/MRuby.framework/Headers/mruby/class.h +14 -11
- data/assets/tvos/MRuby.framework/Headers/mruby/common.h +5 -0
- data/assets/tvos/MRuby.framework/Headers/mruby/compile.h +4 -3
- data/assets/tvos/MRuby.framework/Headers/mruby/debug.h +3 -2
- data/assets/tvos/MRuby.framework/Headers/mruby/dump.h +2 -2
- data/assets/tvos/MRuby.framework/Headers/mruby/hash.h +38 -5
- data/assets/tvos/MRuby.framework/Headers/mruby/irep.h +17 -4
- data/assets/tvos/MRuby.framework/Headers/mruby/object.h +4 -5
- data/assets/tvos/MRuby.framework/Headers/mruby/opcode.h +47 -139
- data/assets/tvos/MRuby.framework/Headers/mruby/ops.h +117 -0
- data/assets/tvos/MRuby.framework/Headers/mruby/proc.h +4 -4
- data/assets/tvos/MRuby.framework/Headers/mruby/string.h +11 -7
- data/assets/tvos/MRuby.framework/Headers/mruby/throw.h +4 -4
- data/assets/tvos/MRuby.framework/Headers/mruby/variable.h +2 -4
- data/assets/tvos/MRuby.framework/Headers/mruby/version.h +6 -6
- data/assets/tvos/MRuby.framework/MRuby +0 -0
- data/assets/tvos/MyApp.xcodeproj/project.pbxproj +25 -19
- data/assets/tvos/MyApp.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- data/assets/tvos/main.c +1 -1
- data/ext/ruby2d/extconf.rb +59 -50
- data/ext/ruby2d/ruby2d.c +0 -1
- data/lib/ruby2d.rb +1 -7
- data/lib/ruby2d/cli/launch.rb +1 -1
- data/lib/ruby2d/font.rb +32 -7
- data/lib/ruby2d/version.rb +1 -1
- metadata +132 -6
- data/assets/opal.js +0 -21637
- data/assets/simple2d.js +0 -1379
- data/assets/template.html +0 -18
@@ -0,0 +1,30 @@
|
|
1
|
+
#ifndef __gl2platform_h_
|
2
|
+
#define __gl2platform_h_
|
3
|
+
|
4
|
+
/* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */
|
5
|
+
|
6
|
+
/*
|
7
|
+
* This document is licensed under the SGI Free Software B License Version
|
8
|
+
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
9
|
+
*/
|
10
|
+
|
11
|
+
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
12
|
+
*
|
13
|
+
* Adopters may modify khrplatform.h and this file to suit their platform.
|
14
|
+
* You are encouraged to submit all modifications to the Khronos group so that
|
15
|
+
* they can be included in future versions of this file. Please submit changes
|
16
|
+
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
17
|
+
* by filing a bug against product "OpenGL-ES" component "Registry".
|
18
|
+
*/
|
19
|
+
|
20
|
+
/*#include <KHR/khrplatform.h>*/
|
21
|
+
|
22
|
+
#ifndef GL_APICALL
|
23
|
+
#define GL_APICALL KHRONOS_APICALL
|
24
|
+
#endif
|
25
|
+
|
26
|
+
#ifndef GL_APIENTRY
|
27
|
+
#define GL_APIENTRY KHRONOS_APIENTRY
|
28
|
+
#endif
|
29
|
+
|
30
|
+
#endif /* __gl2platform_h_ */
|
@@ -0,0 +1,282 @@
|
|
1
|
+
#ifndef __khrplatform_h_
|
2
|
+
#define __khrplatform_h_
|
3
|
+
|
4
|
+
/*
|
5
|
+
** Copyright (c) 2008-2009 The Khronos Group Inc.
|
6
|
+
**
|
7
|
+
** Permission is hereby granted, free of charge, to any person obtaining a
|
8
|
+
** copy of this software and/or associated documentation files (the
|
9
|
+
** "Materials"), to deal in the Materials without restriction, including
|
10
|
+
** without limitation the rights to use, copy, modify, merge, publish,
|
11
|
+
** distribute, sublicense, and/or sell copies of the Materials, and to
|
12
|
+
** permit persons to whom the Materials are furnished to do so, subject to
|
13
|
+
** the following conditions:
|
14
|
+
**
|
15
|
+
** The above copyright notice and this permission notice shall be included
|
16
|
+
** in all copies or substantial portions of the Materials.
|
17
|
+
**
|
18
|
+
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
19
|
+
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
20
|
+
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
21
|
+
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
22
|
+
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
23
|
+
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
24
|
+
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
25
|
+
*/
|
26
|
+
|
27
|
+
/* Khronos platform-specific types and definitions.
|
28
|
+
*
|
29
|
+
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
|
30
|
+
*
|
31
|
+
* Adopters may modify this file to suit their platform. Adopters are
|
32
|
+
* encouraged to submit platform specific modifications to the Khronos
|
33
|
+
* group so that they can be included in future versions of this file.
|
34
|
+
* Please submit changes by sending them to the public Khronos Bugzilla
|
35
|
+
* (http://khronos.org/bugzilla) by filing a bug against product
|
36
|
+
* "Khronos (general)" component "Registry".
|
37
|
+
*
|
38
|
+
* A predefined template which fills in some of the bug fields can be
|
39
|
+
* reached using http://tinyurl.com/khrplatform-h-bugreport, but you
|
40
|
+
* must create a Bugzilla login first.
|
41
|
+
*
|
42
|
+
*
|
43
|
+
* See the Implementer's Guidelines for information about where this file
|
44
|
+
* should be located on your system and for more details of its use:
|
45
|
+
* http://www.khronos.org/registry/implementers_guide.pdf
|
46
|
+
*
|
47
|
+
* This file should be included as
|
48
|
+
* #include <KHR/khrplatform.h>
|
49
|
+
* by Khronos client API header files that use its types and defines.
|
50
|
+
*
|
51
|
+
* The types in khrplatform.h should only be used to define API-specific types.
|
52
|
+
*
|
53
|
+
* Types defined in khrplatform.h:
|
54
|
+
* khronos_int8_t signed 8 bit
|
55
|
+
* khronos_uint8_t unsigned 8 bit
|
56
|
+
* khronos_int16_t signed 16 bit
|
57
|
+
* khronos_uint16_t unsigned 16 bit
|
58
|
+
* khronos_int32_t signed 32 bit
|
59
|
+
* khronos_uint32_t unsigned 32 bit
|
60
|
+
* khronos_int64_t signed 64 bit
|
61
|
+
* khronos_uint64_t unsigned 64 bit
|
62
|
+
* khronos_intptr_t signed same number of bits as a pointer
|
63
|
+
* khronos_uintptr_t unsigned same number of bits as a pointer
|
64
|
+
* khronos_ssize_t signed size
|
65
|
+
* khronos_usize_t unsigned size
|
66
|
+
* khronos_float_t signed 32 bit floating point
|
67
|
+
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
68
|
+
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
69
|
+
* nanoseconds
|
70
|
+
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
71
|
+
* khronos_boolean_enum_t enumerated boolean type. This should
|
72
|
+
* only be used as a base type when a client API's boolean type is
|
73
|
+
* an enum. Client APIs which use an integer or other type for
|
74
|
+
* booleans cannot use this as the base type for their boolean.
|
75
|
+
*
|
76
|
+
* Tokens defined in khrplatform.h:
|
77
|
+
*
|
78
|
+
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
79
|
+
*
|
80
|
+
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
81
|
+
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
82
|
+
*
|
83
|
+
* Calling convention macros defined in this file:
|
84
|
+
* KHRONOS_APICALL
|
85
|
+
* KHRONOS_APIENTRY
|
86
|
+
* KHRONOS_APIATTRIBUTES
|
87
|
+
*
|
88
|
+
* These may be used in function prototypes as:
|
89
|
+
*
|
90
|
+
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
91
|
+
* int arg1,
|
92
|
+
* int arg2) KHRONOS_APIATTRIBUTES;
|
93
|
+
*/
|
94
|
+
|
95
|
+
/*-------------------------------------------------------------------------
|
96
|
+
* Definition of KHRONOS_APICALL
|
97
|
+
*-------------------------------------------------------------------------
|
98
|
+
* This precedes the return type of the function in the function prototype.
|
99
|
+
*/
|
100
|
+
#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
101
|
+
# define KHRONOS_APICALL __declspec(dllimport)
|
102
|
+
#elif defined (__SYMBIAN32__)
|
103
|
+
# define KHRONOS_APICALL IMPORT_C
|
104
|
+
#else
|
105
|
+
# define KHRONOS_APICALL
|
106
|
+
#endif
|
107
|
+
|
108
|
+
/*-------------------------------------------------------------------------
|
109
|
+
* Definition of KHRONOS_APIENTRY
|
110
|
+
*-------------------------------------------------------------------------
|
111
|
+
* This follows the return type of the function and precedes the function
|
112
|
+
* name in the function prototype.
|
113
|
+
*/
|
114
|
+
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
115
|
+
/* Win32 but not WinCE */
|
116
|
+
# define KHRONOS_APIENTRY __stdcall
|
117
|
+
#else
|
118
|
+
# define KHRONOS_APIENTRY
|
119
|
+
#endif
|
120
|
+
|
121
|
+
/*-------------------------------------------------------------------------
|
122
|
+
* Definition of KHRONOS_APIATTRIBUTES
|
123
|
+
*-------------------------------------------------------------------------
|
124
|
+
* This follows the closing parenthesis of the function prototype arguments.
|
125
|
+
*/
|
126
|
+
#if defined (__ARMCC_2__)
|
127
|
+
#define KHRONOS_APIATTRIBUTES __softfp
|
128
|
+
#else
|
129
|
+
#define KHRONOS_APIATTRIBUTES
|
130
|
+
#endif
|
131
|
+
|
132
|
+
/*-------------------------------------------------------------------------
|
133
|
+
* basic type definitions
|
134
|
+
*-----------------------------------------------------------------------*/
|
135
|
+
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
136
|
+
|
137
|
+
|
138
|
+
/*
|
139
|
+
* Using <stdint.h>
|
140
|
+
*/
|
141
|
+
#include <stdint.h>
|
142
|
+
typedef int32_t khronos_int32_t;
|
143
|
+
typedef uint32_t khronos_uint32_t;
|
144
|
+
typedef int64_t khronos_int64_t;
|
145
|
+
typedef uint64_t khronos_uint64_t;
|
146
|
+
#define KHRONOS_SUPPORT_INT64 1
|
147
|
+
#define KHRONOS_SUPPORT_FLOAT 1
|
148
|
+
|
149
|
+
#elif defined(__VMS ) || defined(__sgi)
|
150
|
+
|
151
|
+
/*
|
152
|
+
* Using <inttypes.h>
|
153
|
+
*/
|
154
|
+
#include <inttypes.h>
|
155
|
+
typedef int32_t khronos_int32_t;
|
156
|
+
typedef uint32_t khronos_uint32_t;
|
157
|
+
typedef int64_t khronos_int64_t;
|
158
|
+
typedef uint64_t khronos_uint64_t;
|
159
|
+
#define KHRONOS_SUPPORT_INT64 1
|
160
|
+
#define KHRONOS_SUPPORT_FLOAT 1
|
161
|
+
|
162
|
+
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
163
|
+
|
164
|
+
/*
|
165
|
+
* Win32
|
166
|
+
*/
|
167
|
+
typedef __int32 khronos_int32_t;
|
168
|
+
typedef unsigned __int32 khronos_uint32_t;
|
169
|
+
typedef __int64 khronos_int64_t;
|
170
|
+
typedef unsigned __int64 khronos_uint64_t;
|
171
|
+
#define KHRONOS_SUPPORT_INT64 1
|
172
|
+
#define KHRONOS_SUPPORT_FLOAT 1
|
173
|
+
|
174
|
+
#elif defined(__sun__) || defined(__digital__)
|
175
|
+
|
176
|
+
/*
|
177
|
+
* Sun or Digital
|
178
|
+
*/
|
179
|
+
typedef int khronos_int32_t;
|
180
|
+
typedef unsigned int khronos_uint32_t;
|
181
|
+
#if defined(__arch64__) || defined(_LP64)
|
182
|
+
typedef long int khronos_int64_t;
|
183
|
+
typedef unsigned long int khronos_uint64_t;
|
184
|
+
#else
|
185
|
+
typedef long long int khronos_int64_t;
|
186
|
+
typedef unsigned long long int khronos_uint64_t;
|
187
|
+
#endif /* __arch64__ */
|
188
|
+
#define KHRONOS_SUPPORT_INT64 1
|
189
|
+
#define KHRONOS_SUPPORT_FLOAT 1
|
190
|
+
|
191
|
+
#elif 0
|
192
|
+
|
193
|
+
/*
|
194
|
+
* Hypothetical platform with no float or int64 support
|
195
|
+
*/
|
196
|
+
typedef int khronos_int32_t;
|
197
|
+
typedef unsigned int khronos_uint32_t;
|
198
|
+
#define KHRONOS_SUPPORT_INT64 0
|
199
|
+
#define KHRONOS_SUPPORT_FLOAT 0
|
200
|
+
|
201
|
+
#else
|
202
|
+
|
203
|
+
/*
|
204
|
+
* Generic fallback
|
205
|
+
*/
|
206
|
+
#include <stdint.h>
|
207
|
+
typedef int32_t khronos_int32_t;
|
208
|
+
typedef uint32_t khronos_uint32_t;
|
209
|
+
typedef int64_t khronos_int64_t;
|
210
|
+
typedef uint64_t khronos_uint64_t;
|
211
|
+
#define KHRONOS_SUPPORT_INT64 1
|
212
|
+
#define KHRONOS_SUPPORT_FLOAT 1
|
213
|
+
|
214
|
+
#endif
|
215
|
+
|
216
|
+
|
217
|
+
/*
|
218
|
+
* Types that are (so far) the same on all platforms
|
219
|
+
*/
|
220
|
+
typedef signed char khronos_int8_t;
|
221
|
+
typedef unsigned char khronos_uint8_t;
|
222
|
+
typedef signed short int khronos_int16_t;
|
223
|
+
typedef unsigned short int khronos_uint16_t;
|
224
|
+
|
225
|
+
/*
|
226
|
+
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
227
|
+
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
228
|
+
* to be the only LLP64 architecture in current use.
|
229
|
+
*/
|
230
|
+
#ifdef _WIN64
|
231
|
+
typedef signed long long int khronos_intptr_t;
|
232
|
+
typedef unsigned long long int khronos_uintptr_t;
|
233
|
+
typedef signed long long int khronos_ssize_t;
|
234
|
+
typedef unsigned long long int khronos_usize_t;
|
235
|
+
#else
|
236
|
+
typedef signed long int khronos_intptr_t;
|
237
|
+
typedef unsigned long int khronos_uintptr_t;
|
238
|
+
typedef signed long int khronos_ssize_t;
|
239
|
+
typedef unsigned long int khronos_usize_t;
|
240
|
+
#endif
|
241
|
+
|
242
|
+
#if KHRONOS_SUPPORT_FLOAT
|
243
|
+
/*
|
244
|
+
* Float type
|
245
|
+
*/
|
246
|
+
typedef float khronos_float_t;
|
247
|
+
#endif
|
248
|
+
|
249
|
+
#if KHRONOS_SUPPORT_INT64
|
250
|
+
/* Time types
|
251
|
+
*
|
252
|
+
* These types can be used to represent a time interval in nanoseconds or
|
253
|
+
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
254
|
+
* of nanoseconds since some arbitrary system event (e.g. since the last
|
255
|
+
* time the system booted). The Unadjusted System Time is an unsigned
|
256
|
+
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
257
|
+
* may be either signed or unsigned.
|
258
|
+
*/
|
259
|
+
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
260
|
+
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
261
|
+
#endif
|
262
|
+
|
263
|
+
/*
|
264
|
+
* Dummy value used to pad enum types to 32 bits.
|
265
|
+
*/
|
266
|
+
#ifndef KHRONOS_MAX_ENUM
|
267
|
+
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
268
|
+
#endif
|
269
|
+
|
270
|
+
/*
|
271
|
+
* Enumerated boolean type
|
272
|
+
*
|
273
|
+
* Values other than zero should be considered to be true. Therefore
|
274
|
+
* comparisons should not be made against KHRONOS_TRUE.
|
275
|
+
*/
|
276
|
+
typedef enum {
|
277
|
+
KHRONOS_FALSE = 0,
|
278
|
+
KHRONOS_TRUE = 1,
|
279
|
+
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
280
|
+
} khronos_boolean_enum_t;
|
281
|
+
|
282
|
+
#endif /* __khrplatform_h_ */
|
@@ -0,0 +1,470 @@
|
|
1
|
+
/*
|
2
|
+
Simple DirectMedia Layer
|
3
|
+
Copyright (C) 1997-2018 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
|
+
/**
|
23
|
+
* \file SDL_pixels.h
|
24
|
+
*
|
25
|
+
* Header for the enumerated pixel format definitions.
|
26
|
+
*/
|
27
|
+
|
28
|
+
#ifndef SDL_pixels_h_
|
29
|
+
#define SDL_pixels_h_
|
30
|
+
|
31
|
+
#include "SDL_stdinc.h"
|
32
|
+
#include "SDL_endian.h"
|
33
|
+
|
34
|
+
#include "begin_code.h"
|
35
|
+
/* Set up for C function definitions, even when using C++ */
|
36
|
+
#ifdef __cplusplus
|
37
|
+
extern "C" {
|
38
|
+
#endif
|
39
|
+
|
40
|
+
/**
|
41
|
+
* \name Transparency definitions
|
42
|
+
*
|
43
|
+
* These define alpha as the opacity of a surface.
|
44
|
+
*/
|
45
|
+
/* @{ */
|
46
|
+
#define SDL_ALPHA_OPAQUE 255
|
47
|
+
#define SDL_ALPHA_TRANSPARENT 0
|
48
|
+
/* @} */
|
49
|
+
|
50
|
+
/** Pixel type. */
|
51
|
+
enum
|
52
|
+
{
|
53
|
+
SDL_PIXELTYPE_UNKNOWN,
|
54
|
+
SDL_PIXELTYPE_INDEX1,
|
55
|
+
SDL_PIXELTYPE_INDEX4,
|
56
|
+
SDL_PIXELTYPE_INDEX8,
|
57
|
+
SDL_PIXELTYPE_PACKED8,
|
58
|
+
SDL_PIXELTYPE_PACKED16,
|
59
|
+
SDL_PIXELTYPE_PACKED32,
|
60
|
+
SDL_PIXELTYPE_ARRAYU8,
|
61
|
+
SDL_PIXELTYPE_ARRAYU16,
|
62
|
+
SDL_PIXELTYPE_ARRAYU32,
|
63
|
+
SDL_PIXELTYPE_ARRAYF16,
|
64
|
+
SDL_PIXELTYPE_ARRAYF32
|
65
|
+
};
|
66
|
+
|
67
|
+
/** Bitmap pixel order, high bit -> low bit. */
|
68
|
+
enum
|
69
|
+
{
|
70
|
+
SDL_BITMAPORDER_NONE,
|
71
|
+
SDL_BITMAPORDER_4321,
|
72
|
+
SDL_BITMAPORDER_1234
|
73
|
+
};
|
74
|
+
|
75
|
+
/** Packed component order, high bit -> low bit. */
|
76
|
+
enum
|
77
|
+
{
|
78
|
+
SDL_PACKEDORDER_NONE,
|
79
|
+
SDL_PACKEDORDER_XRGB,
|
80
|
+
SDL_PACKEDORDER_RGBX,
|
81
|
+
SDL_PACKEDORDER_ARGB,
|
82
|
+
SDL_PACKEDORDER_RGBA,
|
83
|
+
SDL_PACKEDORDER_XBGR,
|
84
|
+
SDL_PACKEDORDER_BGRX,
|
85
|
+
SDL_PACKEDORDER_ABGR,
|
86
|
+
SDL_PACKEDORDER_BGRA
|
87
|
+
};
|
88
|
+
|
89
|
+
/** Array component order, low byte -> high byte. */
|
90
|
+
/* !!! FIXME: in 2.1, make these not overlap differently with
|
91
|
+
!!! FIXME: SDL_PACKEDORDER_*, so we can simplify SDL_ISPIXELFORMAT_ALPHA */
|
92
|
+
enum
|
93
|
+
{
|
94
|
+
SDL_ARRAYORDER_NONE,
|
95
|
+
SDL_ARRAYORDER_RGB,
|
96
|
+
SDL_ARRAYORDER_RGBA,
|
97
|
+
SDL_ARRAYORDER_ARGB,
|
98
|
+
SDL_ARRAYORDER_BGR,
|
99
|
+
SDL_ARRAYORDER_BGRA,
|
100
|
+
SDL_ARRAYORDER_ABGR
|
101
|
+
};
|
102
|
+
|
103
|
+
/** Packed component layout. */
|
104
|
+
enum
|
105
|
+
{
|
106
|
+
SDL_PACKEDLAYOUT_NONE,
|
107
|
+
SDL_PACKEDLAYOUT_332,
|
108
|
+
SDL_PACKEDLAYOUT_4444,
|
109
|
+
SDL_PACKEDLAYOUT_1555,
|
110
|
+
SDL_PACKEDLAYOUT_5551,
|
111
|
+
SDL_PACKEDLAYOUT_565,
|
112
|
+
SDL_PACKEDLAYOUT_8888,
|
113
|
+
SDL_PACKEDLAYOUT_2101010,
|
114
|
+
SDL_PACKEDLAYOUT_1010102
|
115
|
+
};
|
116
|
+
|
117
|
+
#define SDL_DEFINE_PIXELFOURCC(A, B, C, D) SDL_FOURCC(A, B, C, D)
|
118
|
+
|
119
|
+
#define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
|
120
|
+
((1 << 28) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
|
121
|
+
((bits) << 8) | ((bytes) << 0))
|
122
|
+
|
123
|
+
#define SDL_PIXELFLAG(X) (((X) >> 28) & 0x0F)
|
124
|
+
#define SDL_PIXELTYPE(X) (((X) >> 24) & 0x0F)
|
125
|
+
#define SDL_PIXELORDER(X) (((X) >> 20) & 0x0F)
|
126
|
+
#define SDL_PIXELLAYOUT(X) (((X) >> 16) & 0x0F)
|
127
|
+
#define SDL_BITSPERPIXEL(X) (((X) >> 8) & 0xFF)
|
128
|
+
#define SDL_BYTESPERPIXEL(X) \
|
129
|
+
(SDL_ISPIXELFORMAT_FOURCC(X) ? \
|
130
|
+
((((X) == SDL_PIXELFORMAT_YUY2) || \
|
131
|
+
((X) == SDL_PIXELFORMAT_UYVY) || \
|
132
|
+
((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
|
133
|
+
|
134
|
+
#define SDL_ISPIXELFORMAT_INDEXED(format) \
|
135
|
+
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
136
|
+
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
|
137
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
|
138
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
|
139
|
+
|
140
|
+
#define SDL_ISPIXELFORMAT_PACKED(format) \
|
141
|
+
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
142
|
+
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED8) || \
|
143
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED16) || \
|
144
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_PACKED32)))
|
145
|
+
|
146
|
+
#define SDL_ISPIXELFORMAT_ARRAY(format) \
|
147
|
+
(!SDL_ISPIXELFORMAT_FOURCC(format) && \
|
148
|
+
((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU8) || \
|
149
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU16) || \
|
150
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYU32) || \
|
151
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF16) || \
|
152
|
+
(SDL_PIXELTYPE(format) == SDL_PIXELTYPE_ARRAYF32)))
|
153
|
+
|
154
|
+
#define SDL_ISPIXELFORMAT_ALPHA(format) \
|
155
|
+
((SDL_ISPIXELFORMAT_PACKED(format) && \
|
156
|
+
((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
|
157
|
+
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
|
158
|
+
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
|
159
|
+
(SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))) || \
|
160
|
+
(SDL_ISPIXELFORMAT_ARRAY(format) && \
|
161
|
+
((SDL_PIXELORDER(format) == SDL_ARRAYORDER_ARGB) || \
|
162
|
+
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_RGBA) || \
|
163
|
+
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_ABGR) || \
|
164
|
+
(SDL_PIXELORDER(format) == SDL_ARRAYORDER_BGRA))))
|
165
|
+
|
166
|
+
/* The flag is set to 1 because 0x1? is not in the printable ASCII range */
|
167
|
+
#define SDL_ISPIXELFORMAT_FOURCC(format) \
|
168
|
+
((format) && (SDL_PIXELFLAG(format) != 1))
|
169
|
+
|
170
|
+
/* Note: If you modify this list, update SDL_GetPixelFormatName() */
|
171
|
+
enum
|
172
|
+
{
|
173
|
+
SDL_PIXELFORMAT_UNKNOWN,
|
174
|
+
SDL_PIXELFORMAT_INDEX1LSB =
|
175
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_4321, 0,
|
176
|
+
1, 0),
|
177
|
+
SDL_PIXELFORMAT_INDEX1MSB =
|
178
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX1, SDL_BITMAPORDER_1234, 0,
|
179
|
+
1, 0),
|
180
|
+
SDL_PIXELFORMAT_INDEX4LSB =
|
181
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_4321, 0,
|
182
|
+
4, 0),
|
183
|
+
SDL_PIXELFORMAT_INDEX4MSB =
|
184
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX4, SDL_BITMAPORDER_1234, 0,
|
185
|
+
4, 0),
|
186
|
+
SDL_PIXELFORMAT_INDEX8 =
|
187
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_INDEX8, 0, 0, 8, 1),
|
188
|
+
SDL_PIXELFORMAT_RGB332 =
|
189
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED8, SDL_PACKEDORDER_XRGB,
|
190
|
+
SDL_PACKEDLAYOUT_332, 8, 1),
|
191
|
+
SDL_PIXELFORMAT_RGB444 =
|
192
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
193
|
+
SDL_PACKEDLAYOUT_4444, 12, 2),
|
194
|
+
SDL_PIXELFORMAT_RGB555 =
|
195
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
196
|
+
SDL_PACKEDLAYOUT_1555, 15, 2),
|
197
|
+
SDL_PIXELFORMAT_BGR555 =
|
198
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
199
|
+
SDL_PACKEDLAYOUT_1555, 15, 2),
|
200
|
+
SDL_PIXELFORMAT_ARGB4444 =
|
201
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
202
|
+
SDL_PACKEDLAYOUT_4444, 16, 2),
|
203
|
+
SDL_PIXELFORMAT_RGBA4444 =
|
204
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
|
205
|
+
SDL_PACKEDLAYOUT_4444, 16, 2),
|
206
|
+
SDL_PIXELFORMAT_ABGR4444 =
|
207
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
208
|
+
SDL_PACKEDLAYOUT_4444, 16, 2),
|
209
|
+
SDL_PIXELFORMAT_BGRA4444 =
|
210
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
|
211
|
+
SDL_PACKEDLAYOUT_4444, 16, 2),
|
212
|
+
SDL_PIXELFORMAT_ARGB1555 =
|
213
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
|
214
|
+
SDL_PACKEDLAYOUT_1555, 16, 2),
|
215
|
+
SDL_PIXELFORMAT_RGBA5551 =
|
216
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
|
217
|
+
SDL_PACKEDLAYOUT_5551, 16, 2),
|
218
|
+
SDL_PIXELFORMAT_ABGR1555 =
|
219
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
|
220
|
+
SDL_PACKEDLAYOUT_1555, 16, 2),
|
221
|
+
SDL_PIXELFORMAT_BGRA5551 =
|
222
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
|
223
|
+
SDL_PACKEDLAYOUT_5551, 16, 2),
|
224
|
+
SDL_PIXELFORMAT_RGB565 =
|
225
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
|
226
|
+
SDL_PACKEDLAYOUT_565, 16, 2),
|
227
|
+
SDL_PIXELFORMAT_BGR565 =
|
228
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XBGR,
|
229
|
+
SDL_PACKEDLAYOUT_565, 16, 2),
|
230
|
+
SDL_PIXELFORMAT_RGB24 =
|
231
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_RGB, 0,
|
232
|
+
24, 3),
|
233
|
+
SDL_PIXELFORMAT_BGR24 =
|
234
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU8, SDL_ARRAYORDER_BGR, 0,
|
235
|
+
24, 3),
|
236
|
+
SDL_PIXELFORMAT_RGB888 =
|
237
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XRGB,
|
238
|
+
SDL_PACKEDLAYOUT_8888, 24, 4),
|
239
|
+
SDL_PIXELFORMAT_RGBX8888 =
|
240
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBX,
|
241
|
+
SDL_PACKEDLAYOUT_8888, 24, 4),
|
242
|
+
SDL_PIXELFORMAT_BGR888 =
|
243
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_XBGR,
|
244
|
+
SDL_PACKEDLAYOUT_8888, 24, 4),
|
245
|
+
SDL_PIXELFORMAT_BGRX8888 =
|
246
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRX,
|
247
|
+
SDL_PACKEDLAYOUT_8888, 24, 4),
|
248
|
+
SDL_PIXELFORMAT_ARGB8888 =
|
249
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
250
|
+
SDL_PACKEDLAYOUT_8888, 32, 4),
|
251
|
+
SDL_PIXELFORMAT_RGBA8888 =
|
252
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_RGBA,
|
253
|
+
SDL_PACKEDLAYOUT_8888, 32, 4),
|
254
|
+
SDL_PIXELFORMAT_ABGR8888 =
|
255
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ABGR,
|
256
|
+
SDL_PACKEDLAYOUT_8888, 32, 4),
|
257
|
+
SDL_PIXELFORMAT_BGRA8888 =
|
258
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_BGRA,
|
259
|
+
SDL_PACKEDLAYOUT_8888, 32, 4),
|
260
|
+
SDL_PIXELFORMAT_ARGB2101010 =
|
261
|
+
SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED32, SDL_PACKEDORDER_ARGB,
|
262
|
+
SDL_PACKEDLAYOUT_2101010, 32, 4),
|
263
|
+
|
264
|
+
/* Aliases for RGBA byte arrays of color data, for the current platform */
|
265
|
+
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
|
266
|
+
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_RGBA8888,
|
267
|
+
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_ARGB8888,
|
268
|
+
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_BGRA8888,
|
269
|
+
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_ABGR8888,
|
270
|
+
#else
|
271
|
+
SDL_PIXELFORMAT_RGBA32 = SDL_PIXELFORMAT_ABGR8888,
|
272
|
+
SDL_PIXELFORMAT_ARGB32 = SDL_PIXELFORMAT_BGRA8888,
|
273
|
+
SDL_PIXELFORMAT_BGRA32 = SDL_PIXELFORMAT_ARGB8888,
|
274
|
+
SDL_PIXELFORMAT_ABGR32 = SDL_PIXELFORMAT_RGBA8888,
|
275
|
+
#endif
|
276
|
+
|
277
|
+
SDL_PIXELFORMAT_YV12 = /**< Planar mode: Y + V + U (3 planes) */
|
278
|
+
SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
|
279
|
+
SDL_PIXELFORMAT_IYUV = /**< Planar mode: Y + U + V (3 planes) */
|
280
|
+
SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
|
281
|
+
SDL_PIXELFORMAT_YUY2 = /**< Packed mode: Y0+U0+Y1+V0 (1 plane) */
|
282
|
+
SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
|
283
|
+
SDL_PIXELFORMAT_UYVY = /**< Packed mode: U0+Y0+V0+Y1 (1 plane) */
|
284
|
+
SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
|
285
|
+
SDL_PIXELFORMAT_YVYU = /**< Packed mode: Y0+V0+Y1+U0 (1 plane) */
|
286
|
+
SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
|
287
|
+
SDL_PIXELFORMAT_NV12 = /**< Planar mode: Y + U/V interleaved (2 planes) */
|
288
|
+
SDL_DEFINE_PIXELFOURCC('N', 'V', '1', '2'),
|
289
|
+
SDL_PIXELFORMAT_NV21 = /**< Planar mode: Y + V/U interleaved (2 planes) */
|
290
|
+
SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
|
291
|
+
SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
|
292
|
+
SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
|
293
|
+
};
|
294
|
+
|
295
|
+
typedef struct SDL_Color
|
296
|
+
{
|
297
|
+
Uint8 r;
|
298
|
+
Uint8 g;
|
299
|
+
Uint8 b;
|
300
|
+
Uint8 a;
|
301
|
+
} SDL_Color;
|
302
|
+
#define SDL_Colour SDL_Color
|
303
|
+
|
304
|
+
typedef struct SDL_Palette
|
305
|
+
{
|
306
|
+
int ncolors;
|
307
|
+
SDL_Color *colors;
|
308
|
+
Uint32 version;
|
309
|
+
int refcount;
|
310
|
+
} SDL_Palette;
|
311
|
+
|
312
|
+
/**
|
313
|
+
* \note Everything in the pixel format structure is read-only.
|
314
|
+
*/
|
315
|
+
typedef struct SDL_PixelFormat
|
316
|
+
{
|
317
|
+
Uint32 format;
|
318
|
+
SDL_Palette *palette;
|
319
|
+
Uint8 BitsPerPixel;
|
320
|
+
Uint8 BytesPerPixel;
|
321
|
+
Uint8 padding[2];
|
322
|
+
Uint32 Rmask;
|
323
|
+
Uint32 Gmask;
|
324
|
+
Uint32 Bmask;
|
325
|
+
Uint32 Amask;
|
326
|
+
Uint8 Rloss;
|
327
|
+
Uint8 Gloss;
|
328
|
+
Uint8 Bloss;
|
329
|
+
Uint8 Aloss;
|
330
|
+
Uint8 Rshift;
|
331
|
+
Uint8 Gshift;
|
332
|
+
Uint8 Bshift;
|
333
|
+
Uint8 Ashift;
|
334
|
+
int refcount;
|
335
|
+
struct SDL_PixelFormat *next;
|
336
|
+
} SDL_PixelFormat;
|
337
|
+
|
338
|
+
/**
|
339
|
+
* \brief Get the human readable name of a pixel format
|
340
|
+
*/
|
341
|
+
extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
|
342
|
+
|
343
|
+
/**
|
344
|
+
* \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
|
345
|
+
*
|
346
|
+
* \return SDL_TRUE, or SDL_FALSE if the conversion wasn't possible.
|
347
|
+
*
|
348
|
+
* \sa SDL_MasksToPixelFormatEnum()
|
349
|
+
*/
|
350
|
+
extern DECLSPEC SDL_bool SDLCALL SDL_PixelFormatEnumToMasks(Uint32 format,
|
351
|
+
int *bpp,
|
352
|
+
Uint32 * Rmask,
|
353
|
+
Uint32 * Gmask,
|
354
|
+
Uint32 * Bmask,
|
355
|
+
Uint32 * Amask);
|
356
|
+
|
357
|
+
/**
|
358
|
+
* \brief Convert a bpp and RGBA masks to an enumerated pixel format.
|
359
|
+
*
|
360
|
+
* \return The pixel format, or ::SDL_PIXELFORMAT_UNKNOWN if the conversion
|
361
|
+
* wasn't possible.
|
362
|
+
*
|
363
|
+
* \sa SDL_PixelFormatEnumToMasks()
|
364
|
+
*/
|
365
|
+
extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
|
366
|
+
Uint32 Rmask,
|
367
|
+
Uint32 Gmask,
|
368
|
+
Uint32 Bmask,
|
369
|
+
Uint32 Amask);
|
370
|
+
|
371
|
+
/**
|
372
|
+
* \brief Create an SDL_PixelFormat structure from a pixel format enum.
|
373
|
+
*/
|
374
|
+
extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
|
375
|
+
|
376
|
+
/**
|
377
|
+
* \brief Free an SDL_PixelFormat structure.
|
378
|
+
*/
|
379
|
+
extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
|
380
|
+
|
381
|
+
/**
|
382
|
+
* \brief Create a palette structure with the specified number of color
|
383
|
+
* entries.
|
384
|
+
*
|
385
|
+
* \return A new palette, or NULL if there wasn't enough memory.
|
386
|
+
*
|
387
|
+
* \note The palette entries are initialized to white.
|
388
|
+
*
|
389
|
+
* \sa SDL_FreePalette()
|
390
|
+
*/
|
391
|
+
extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
|
392
|
+
|
393
|
+
/**
|
394
|
+
* \brief Set the palette for a pixel format structure.
|
395
|
+
*/
|
396
|
+
extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
|
397
|
+
SDL_Palette *palette);
|
398
|
+
|
399
|
+
/**
|
400
|
+
* \brief Set a range of colors in a palette.
|
401
|
+
*
|
402
|
+
* \param palette The palette to modify.
|
403
|
+
* \param colors An array of colors to copy into the palette.
|
404
|
+
* \param firstcolor The index of the first palette entry to modify.
|
405
|
+
* \param ncolors The number of entries to modify.
|
406
|
+
*
|
407
|
+
* \return 0 on success, or -1 if not all of the colors could be set.
|
408
|
+
*/
|
409
|
+
extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
|
410
|
+
const SDL_Color * colors,
|
411
|
+
int firstcolor, int ncolors);
|
412
|
+
|
413
|
+
/**
|
414
|
+
* \brief Free a palette created with SDL_AllocPalette().
|
415
|
+
*
|
416
|
+
* \sa SDL_AllocPalette()
|
417
|
+
*/
|
418
|
+
extern DECLSPEC void SDLCALL SDL_FreePalette(SDL_Palette * palette);
|
419
|
+
|
420
|
+
/**
|
421
|
+
* \brief Maps an RGB triple to an opaque pixel value for a given pixel format.
|
422
|
+
*
|
423
|
+
* \sa SDL_MapRGBA
|
424
|
+
*/
|
425
|
+
extern DECLSPEC Uint32 SDLCALL SDL_MapRGB(const SDL_PixelFormat * format,
|
426
|
+
Uint8 r, Uint8 g, Uint8 b);
|
427
|
+
|
428
|
+
/**
|
429
|
+
* \brief Maps an RGBA quadruple to a pixel value for a given pixel format.
|
430
|
+
*
|
431
|
+
* \sa SDL_MapRGB
|
432
|
+
*/
|
433
|
+
extern DECLSPEC Uint32 SDLCALL SDL_MapRGBA(const SDL_PixelFormat * format,
|
434
|
+
Uint8 r, Uint8 g, Uint8 b,
|
435
|
+
Uint8 a);
|
436
|
+
|
437
|
+
/**
|
438
|
+
* \brief Get the RGB components from a pixel of the specified format.
|
439
|
+
*
|
440
|
+
* \sa SDL_GetRGBA
|
441
|
+
*/
|
442
|
+
extern DECLSPEC void SDLCALL SDL_GetRGB(Uint32 pixel,
|
443
|
+
const SDL_PixelFormat * format,
|
444
|
+
Uint8 * r, Uint8 * g, Uint8 * b);
|
445
|
+
|
446
|
+
/**
|
447
|
+
* \brief Get the RGBA components from a pixel of the specified format.
|
448
|
+
*
|
449
|
+
* \sa SDL_GetRGB
|
450
|
+
*/
|
451
|
+
extern DECLSPEC void SDLCALL SDL_GetRGBA(Uint32 pixel,
|
452
|
+
const SDL_PixelFormat * format,
|
453
|
+
Uint8 * r, Uint8 * g, Uint8 * b,
|
454
|
+
Uint8 * a);
|
455
|
+
|
456
|
+
/**
|
457
|
+
* \brief Calculate a 256 entry gamma ramp for a gamma value.
|
458
|
+
*/
|
459
|
+
extern DECLSPEC void SDLCALL SDL_CalculateGammaRamp(float gamma, Uint16 * ramp);
|
460
|
+
|
461
|
+
|
462
|
+
/* Ends C function definitions when using C++ */
|
463
|
+
#ifdef __cplusplus
|
464
|
+
}
|
465
|
+
#endif
|
466
|
+
#include "close_code.h"
|
467
|
+
|
468
|
+
#endif /* SDL_pixels_h_ */
|
469
|
+
|
470
|
+
/* vi: set ts=4 sw=4 expandtab: */
|