ruby2d 0.9.0 → 0.9.5
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 +8 -8
- data/assets/Rakefile +85 -0
- data/assets/include/SDL2/SDL.h +1 -1
- data/assets/include/SDL2/SDL_assert.h +1 -1
- data/assets/include/SDL2/SDL_atomic.h +20 -2
- data/assets/include/SDL2/SDL_audio.h +47 -14
- data/assets/include/SDL2/SDL_bits.h +10 -1
- data/assets/include/SDL2/SDL_blendmode.h +7 -7
- data/assets/include/SDL2/SDL_clipboard.h +1 -1
- data/assets/include/SDL2/SDL_config.h +24 -390
- data/assets/include/SDL2/SDL_config_android.h +178 -0
- data/assets/include/SDL2/SDL_config_iphoneos.h +201 -0
- data/assets/include/SDL2/SDL_config_macosx.h +240 -0
- data/assets/include/SDL2/SDL_config_minimal.h +85 -0
- data/assets/include/SDL2/SDL_config_os2.h +170 -0
- data/assets/include/SDL2/SDL_config_pandora.h +133 -0
- data/assets/include/SDL2/SDL_config_psp.h +164 -0
- data/assets/include/SDL2/SDL_config_windows.h +257 -0
- data/assets/include/SDL2/SDL_config_winrt.h +240 -0
- data/assets/include/SDL2/SDL_config_wiz.h +146 -0
- data/assets/include/SDL2/SDL_copying.h +20 -0
- data/assets/include/SDL2/SDL_cpuinfo.h +90 -8
- data/assets/include/SDL2/SDL_egl.h +1 -1
- data/assets/include/SDL2/SDL_endian.h +1 -1
- data/assets/include/SDL2/SDL_error.h +1 -1
- data/assets/include/SDL2/SDL_events.h +4 -1
- data/assets/include/SDL2/SDL_filesystem.h +1 -1
- data/assets/include/SDL2/SDL_gamecontroller.h +1 -1
- data/assets/include/SDL2/SDL_gesture.h +1 -1
- data/assets/include/SDL2/SDL_haptic.h +1 -1
- data/assets/include/SDL2/SDL_hints.h +145 -14
- data/assets/include/SDL2/SDL_image.h +2 -2
- data/assets/include/SDL2/SDL_joystick.h +1 -1
- data/assets/include/SDL2/SDL_keyboard.h +1 -1
- data/assets/include/SDL2/SDL_keycode.h +1 -1
- data/assets/include/SDL2/SDL_loadso.h +1 -1
- data/assets/include/SDL2/SDL_log.h +1 -1
- data/assets/include/SDL2/SDL_main.h +28 -16
- data/assets/include/SDL2/SDL_messagebox.h +1 -1
- data/assets/include/SDL2/SDL_mouse.h +1 -1
- data/assets/include/SDL2/SDL_mutex.h +1 -1
- data/assets/include/SDL2/SDL_name.h +1 -1
- data/assets/include/SDL2/SDL_opengl.h +1 -1
- data/assets/include/SDL2/SDL_opengles.h +1 -1
- data/assets/include/SDL2/SDL_opengles2.h +1 -1
- data/assets/include/SDL2/SDL_pixels.h +3 -3
- data/assets/include/SDL2/SDL_platform.h +1 -1
- data/assets/include/SDL2/SDL_power.h +1 -1
- data/assets/include/SDL2/SDL_quit.h +1 -1
- data/assets/include/SDL2/SDL_rect.h +29 -3
- data/assets/include/SDL2/SDL_render.h +168 -1
- data/assets/include/SDL2/SDL_revision.h +2 -2
- data/assets/include/SDL2/SDL_rwops.h +50 -13
- data/assets/include/SDL2/SDL_scancode.h +2 -2
- data/assets/include/SDL2/SDL_sensor.h +4 -4
- data/assets/include/SDL2/SDL_shape.h +1 -1
- data/assets/include/SDL2/SDL_stdinc.h +1 -1
- data/assets/include/SDL2/SDL_surface.h +2 -1
- data/assets/include/SDL2/SDL_system.h +1 -1
- data/assets/include/SDL2/SDL_syswm.h +11 -8
- data/assets/include/SDL2/SDL_test.h +1 -1
- data/assets/include/SDL2/SDL_test_assert.h +1 -1
- data/assets/include/SDL2/SDL_test_common.h +22 -5
- data/assets/include/SDL2/SDL_test_compare.h +1 -1
- data/assets/include/SDL2/SDL_test_crc32.h +1 -1
- data/assets/include/SDL2/SDL_test_font.h +1 -1
- data/assets/include/SDL2/SDL_test_fuzzer.h +1 -1
- data/assets/include/SDL2/SDL_test_harness.h +1 -1
- data/assets/include/SDL2/SDL_test_images.h +1 -1
- data/assets/include/SDL2/SDL_test_log.h +1 -1
- data/assets/include/SDL2/SDL_test_md5.h +1 -1
- data/assets/include/SDL2/SDL_test_memory.h +3 -3
- data/assets/include/SDL2/SDL_test_random.h +1 -1
- data/assets/include/SDL2/SDL_thread.h +1 -1
- data/assets/include/SDL2/SDL_timer.h +1 -1
- data/assets/include/SDL2/SDL_touch.h +17 -1
- data/assets/include/SDL2/SDL_types.h +1 -1
- data/assets/include/SDL2/SDL_version.h +2 -2
- data/assets/include/SDL2/SDL_video.h +1 -1
- data/assets/include/SDL2/SDL_vulkan.h +3 -3
- data/assets/include/SDL2/begin_code.h +4 -1
- data/assets/include/SDL2/close_code.h +4 -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/libtiff.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/libpng16-16.dll +0 -0
- data/assets/mingw/bin/libtiff-5.dll +0 -0
- data/assets/mingw/bin/libwebp-7.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_test.a +0 -0
- data/assets/mingw/lib/libSDL2main.a +0 -0
- data/bin/ruby2d +2 -1
- data/ext/ruby2d/common.c +185 -0
- data/ext/ruby2d/controllers.c +110 -0
- data/ext/ruby2d/extconf.rb +97 -46
- data/ext/ruby2d/gl.c +430 -0
- data/ext/ruby2d/gl2.c +146 -0
- data/ext/ruby2d/gl3.c +348 -0
- data/ext/ruby2d/gles.c +308 -0
- data/ext/ruby2d/image.c +138 -0
- data/ext/ruby2d/input.c +48 -0
- data/ext/ruby2d/music.c +114 -0
- data/ext/ruby2d/ruby2d.c +125 -126
- data/{assets/include/simple2d.h → ext/ruby2d/ruby2d.h} +223 -201
- data/ext/ruby2d/shapes.c +154 -0
- data/ext/ruby2d/sound.c +93 -0
- data/ext/ruby2d/sprite.c +147 -0
- data/ext/ruby2d/text.c +129 -0
- data/ext/ruby2d/window.c +414 -0
- data/lib/ruby2d.rb +1 -1
- data/lib/ruby2d/cli/build.rb +3 -8
- data/lib/ruby2d/cli/colorize.rb +10 -0
- data/lib/ruby2d/version.rb +1 -1
- metadata +34 -10
- data/assets/macos/lib/libsimple2d.a +0 -0
- data/assets/mingw/lib/libsimple2d.a +0 -0
- data/lib/ruby2d/colorize.rb +0 -10
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
SDL_image: An example image loading library for use with SDL
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -37,7 +37,7 @@ extern "C" {
|
|
37
37
|
*/
|
38
38
|
#define SDL_IMAGE_MAJOR_VERSION 2
|
39
39
|
#define SDL_IMAGE_MINOR_VERSION 0
|
40
|
-
#define SDL_IMAGE_PATCHLEVEL
|
40
|
+
#define SDL_IMAGE_PATCHLEVEL 5
|
41
41
|
|
42
42
|
/* This macro can be used to fill a version structure with the compile-time
|
43
43
|
* version of the SDL_image library.
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -55,6 +55,10 @@
|
|
55
55
|
/* On iOS SDL provides a main function that creates an application delegate
|
56
56
|
and starts the iOS application run loop.
|
57
57
|
|
58
|
+
If you link with SDL dynamically on iOS, the main function can't be in a
|
59
|
+
shared library, so you need to link with libSDLmain.a, which includes a
|
60
|
+
stub main function that calls into the shared library to start execution.
|
61
|
+
|
58
62
|
See src/video/uikit/SDL_uikitappdelegate.m for more details.
|
59
63
|
*/
|
60
64
|
#define SDL_MAIN_NEEDED
|
@@ -82,12 +86,6 @@
|
|
82
86
|
#endif
|
83
87
|
#endif /* SDL_MAIN_HANDLED */
|
84
88
|
|
85
|
-
#ifdef __cplusplus
|
86
|
-
#define C_LINKAGE "C"
|
87
|
-
#else
|
88
|
-
#define C_LINKAGE
|
89
|
-
#endif /* __cplusplus */
|
90
|
-
|
91
89
|
#ifndef SDLMAIN_DECLSPEC
|
92
90
|
#define SDLMAIN_DECLSPEC
|
93
91
|
#endif
|
@@ -111,17 +109,18 @@
|
|
111
109
|
#define main SDL_main
|
112
110
|
#endif
|
113
111
|
|
114
|
-
/**
|
115
|
-
* The prototype for the application's main() function
|
116
|
-
*/
|
117
|
-
extern C_LINKAGE SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
|
118
|
-
|
119
|
-
|
120
112
|
#include "begin_code.h"
|
121
113
|
#ifdef __cplusplus
|
122
114
|
extern "C" {
|
123
115
|
#endif
|
124
116
|
|
117
|
+
/**
|
118
|
+
* The prototype for the application's main() function
|
119
|
+
*/
|
120
|
+
typedef int (*SDL_main_func)(int argc, char *argv[]);
|
121
|
+
extern SDLMAIN_DECLSPEC int SDL_main(int argc, char *argv[]);
|
122
|
+
|
123
|
+
|
125
124
|
/**
|
126
125
|
* This is called by the real SDL main function to let the rest of the
|
127
126
|
* library know that initialization was done properly.
|
@@ -136,8 +135,7 @@ extern DECLSPEC void SDLCALL SDL_SetMainReady(void);
|
|
136
135
|
/**
|
137
136
|
* This can be called to set the application class at startup
|
138
137
|
*/
|
139
|
-
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style,
|
140
|
-
void *hInst);
|
138
|
+
extern DECLSPEC int SDLCALL SDL_RegisterApp(char *name, Uint32 style, void *hInst);
|
141
139
|
extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
142
140
|
|
143
141
|
#endif /* __WIN32__ */
|
@@ -153,10 +151,24 @@ extern DECLSPEC void SDLCALL SDL_UnregisterApp(void);
|
|
153
151
|
* \return 0 on success, -1 on failure. On failure, use SDL_GetError to retrieve more
|
154
152
|
* information on the failure.
|
155
153
|
*/
|
156
|
-
extern DECLSPEC int SDLCALL SDL_WinRTRunApp(
|
154
|
+
extern DECLSPEC int SDLCALL SDL_WinRTRunApp(SDL_main_func mainFunction, void * reserved);
|
157
155
|
|
158
156
|
#endif /* __WINRT__ */
|
159
157
|
|
158
|
+
#if defined(__IPHONEOS__)
|
159
|
+
|
160
|
+
/**
|
161
|
+
* \brief Initializes and launches an SDL application.
|
162
|
+
*
|
163
|
+
* \param argc The argc parameter from the application's main() function
|
164
|
+
* \param argv The argv parameter from the application's main() function
|
165
|
+
* \param mainFunction The SDL app's C-style main().
|
166
|
+
* \return the return value from mainFunction
|
167
|
+
*/
|
168
|
+
extern DECLSPEC int SDLCALL SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction);
|
169
|
+
|
170
|
+
#endif /* __IPHONEOS__ */
|
171
|
+
|
160
172
|
|
161
173
|
#ifdef __cplusplus
|
162
174
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -168,7 +168,7 @@ enum
|
|
168
168
|
((format) && (SDL_PIXELFLAG(format) != 1))
|
169
169
|
|
170
170
|
/* Note: If you modify this list, update SDL_GetPixelFormatName() */
|
171
|
-
enum
|
171
|
+
typedef enum
|
172
172
|
{
|
173
173
|
SDL_PIXELFORMAT_UNKNOWN,
|
174
174
|
SDL_PIXELFORMAT_INDEX1LSB =
|
@@ -290,7 +290,7 @@ enum
|
|
290
290
|
SDL_DEFINE_PIXELFOURCC('N', 'V', '2', '1'),
|
291
291
|
SDL_PIXELFORMAT_EXTERNAL_OES = /**< Android video texture format */
|
292
292
|
SDL_DEFINE_PIXELFOURCC('O', 'E', 'S', ' ')
|
293
|
-
};
|
293
|
+
} SDL_PixelFormatEnum;
|
294
294
|
|
295
295
|
typedef struct SDL_Color
|
296
296
|
{
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -40,7 +40,7 @@ extern "C" {
|
|
40
40
|
#endif
|
41
41
|
|
42
42
|
/**
|
43
|
-
* \brief The structure that defines a point
|
43
|
+
* \brief The structure that defines a point (integer)
|
44
44
|
*
|
45
45
|
* \sa SDL_EnclosePoints
|
46
46
|
* \sa SDL_PointInRect
|
@@ -52,7 +52,20 @@ typedef struct SDL_Point
|
|
52
52
|
} SDL_Point;
|
53
53
|
|
54
54
|
/**
|
55
|
-
* \brief
|
55
|
+
* \brief The structure that defines a point (floating point)
|
56
|
+
*
|
57
|
+
* \sa SDL_EnclosePoints
|
58
|
+
* \sa SDL_PointInRect
|
59
|
+
*/
|
60
|
+
typedef struct SDL_FPoint
|
61
|
+
{
|
62
|
+
float x;
|
63
|
+
float y;
|
64
|
+
} SDL_FPoint;
|
65
|
+
|
66
|
+
|
67
|
+
/**
|
68
|
+
* \brief A rectangle, with the origin at the upper left (integer).
|
56
69
|
*
|
57
70
|
* \sa SDL_RectEmpty
|
58
71
|
* \sa SDL_RectEquals
|
@@ -67,6 +80,19 @@ typedef struct SDL_Rect
|
|
67
80
|
int w, h;
|
68
81
|
} SDL_Rect;
|
69
82
|
|
83
|
+
|
84
|
+
/**
|
85
|
+
* \brief A rectangle, with the origin at the upper left (floating point).
|
86
|
+
*/
|
87
|
+
typedef struct SDL_FRect
|
88
|
+
{
|
89
|
+
float x;
|
90
|
+
float y;
|
91
|
+
float w;
|
92
|
+
float h;
|
93
|
+
} SDL_FRect;
|
94
|
+
|
95
|
+
|
70
96
|
/**
|
71
97
|
* \brief Returns true if point resides inside a rectangle.
|
72
98
|
*/
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
Simple DirectMedia Layer
|
3
|
-
Copyright (C) 1997-
|
3
|
+
Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
|
4
4
|
|
5
5
|
This software is provided 'as-is', without any express or implied
|
6
6
|
warranty. In no event will the authors be held liable for any damages
|
@@ -835,6 +835,148 @@ extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer,
|
|
835
835
|
const SDL_Point *center,
|
836
836
|
const SDL_RendererFlip flip);
|
837
837
|
|
838
|
+
|
839
|
+
/**
|
840
|
+
* \brief Draw a point on the current rendering target.
|
841
|
+
*
|
842
|
+
* \param renderer The renderer which should draw a point.
|
843
|
+
* \param x The x coordinate of the point.
|
844
|
+
* \param y The y coordinate of the point.
|
845
|
+
*
|
846
|
+
* \return 0 on success, or -1 on error
|
847
|
+
*/
|
848
|
+
extern DECLSPEC int SDLCALL SDL_RenderDrawPointF(SDL_Renderer * renderer,
|
849
|
+
float x, float y);
|
850
|
+
|
851
|
+
/**
|
852
|
+
* \brief Draw multiple points on the current rendering target.
|
853
|
+
*
|
854
|
+
* \param renderer The renderer which should draw multiple points.
|
855
|
+
* \param points The points to draw
|
856
|
+
* \param count The number of points to draw
|
857
|
+
*
|
858
|
+
* \return 0 on success, or -1 on error
|
859
|
+
*/
|
860
|
+
extern DECLSPEC int SDLCALL SDL_RenderDrawPointsF(SDL_Renderer * renderer,
|
861
|
+
const SDL_FPoint * points,
|
862
|
+
int count);
|
863
|
+
|
864
|
+
/**
|
865
|
+
* \brief Draw a line on the current rendering target.
|
866
|
+
*
|
867
|
+
* \param renderer The renderer which should draw a line.
|
868
|
+
* \param x1 The x coordinate of the start point.
|
869
|
+
* \param y1 The y coordinate of the start point.
|
870
|
+
* \param x2 The x coordinate of the end point.
|
871
|
+
* \param y2 The y coordinate of the end point.
|
872
|
+
*
|
873
|
+
* \return 0 on success, or -1 on error
|
874
|
+
*/
|
875
|
+
extern DECLSPEC int SDLCALL SDL_RenderDrawLineF(SDL_Renderer * renderer,
|
876
|
+
float x1, float y1, float x2, float y2);
|
877
|
+
|
878
|
+
/**
|
879
|
+
* \brief Draw a series of connected lines on the current rendering target.
|
880
|
+
*
|
881
|
+
* \param renderer The renderer which should draw multiple lines.
|
882
|
+
* \param points The points along the lines
|
883
|
+
* \param count The number of points, drawing count-1 lines
|
884
|
+
*
|
885
|
+
* \return 0 on success, or -1 on error
|
886
|
+
*/
|
887
|
+
extern DECLSPEC int SDLCALL SDL_RenderDrawLinesF(SDL_Renderer * renderer,
|
888
|
+
const SDL_FPoint * points,
|
889
|
+
int count);
|
890
|
+
|
891
|
+
/**
|
892
|
+
* \brief Draw a rectangle on the current rendering target.
|
893
|
+
*
|
894
|
+
* \param renderer The renderer which should draw a rectangle.
|
895
|
+
* \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
|
896
|
+
*
|
897
|
+
* \return 0 on success, or -1 on error
|
898
|
+
*/
|
899
|
+
extern DECLSPEC int SDLCALL SDL_RenderDrawRectF(SDL_Renderer * renderer,
|
900
|
+
const SDL_FRect * rect);
|
901
|
+
|
902
|
+
/**
|
903
|
+
* \brief Draw some number of rectangles on the current rendering target.
|
904
|
+
*
|
905
|
+
* \param renderer The renderer which should draw multiple rectangles.
|
906
|
+
* \param rects A pointer to an array of destination rectangles.
|
907
|
+
* \param count The number of rectangles.
|
908
|
+
*
|
909
|
+
* \return 0 on success, or -1 on error
|
910
|
+
*/
|
911
|
+
extern DECLSPEC int SDLCALL SDL_RenderDrawRectsF(SDL_Renderer * renderer,
|
912
|
+
const SDL_FRect * rects,
|
913
|
+
int count);
|
914
|
+
|
915
|
+
/**
|
916
|
+
* \brief Fill a rectangle on the current rendering target with the drawing color.
|
917
|
+
*
|
918
|
+
* \param renderer The renderer which should fill a rectangle.
|
919
|
+
* \param rect A pointer to the destination rectangle, or NULL for the entire
|
920
|
+
* rendering target.
|
921
|
+
*
|
922
|
+
* \return 0 on success, or -1 on error
|
923
|
+
*/
|
924
|
+
extern DECLSPEC int SDLCALL SDL_RenderFillRectF(SDL_Renderer * renderer,
|
925
|
+
const SDL_FRect * rect);
|
926
|
+
|
927
|
+
/**
|
928
|
+
* \brief Fill some number of rectangles on the current rendering target with the drawing color.
|
929
|
+
*
|
930
|
+
* \param renderer The renderer which should fill multiple rectangles.
|
931
|
+
* \param rects A pointer to an array of destination rectangles.
|
932
|
+
* \param count The number of rectangles.
|
933
|
+
*
|
934
|
+
* \return 0 on success, or -1 on error
|
935
|
+
*/
|
936
|
+
extern DECLSPEC int SDLCALL SDL_RenderFillRectsF(SDL_Renderer * renderer,
|
937
|
+
const SDL_FRect * rects,
|
938
|
+
int count);
|
939
|
+
|
940
|
+
/**
|
941
|
+
* \brief Copy a portion of the texture to the current rendering target.
|
942
|
+
*
|
943
|
+
* \param renderer The renderer which should copy parts of a texture.
|
944
|
+
* \param texture The source texture.
|
945
|
+
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
946
|
+
* texture.
|
947
|
+
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
948
|
+
* entire rendering target.
|
949
|
+
*
|
950
|
+
* \return 0 on success, or -1 on error
|
951
|
+
*/
|
952
|
+
extern DECLSPEC int SDLCALL SDL_RenderCopyF(SDL_Renderer * renderer,
|
953
|
+
SDL_Texture * texture,
|
954
|
+
const SDL_Rect * srcrect,
|
955
|
+
const SDL_FRect * dstrect);
|
956
|
+
|
957
|
+
/**
|
958
|
+
* \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
|
959
|
+
*
|
960
|
+
* \param renderer The renderer which should copy parts of a texture.
|
961
|
+
* \param texture The source texture.
|
962
|
+
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
963
|
+
* texture.
|
964
|
+
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
965
|
+
* entire rendering target.
|
966
|
+
* \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
|
967
|
+
* \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
|
968
|
+
* \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
|
969
|
+
*
|
970
|
+
* \return 0 on success, or -1 on error
|
971
|
+
*/
|
972
|
+
extern DECLSPEC int SDLCALL SDL_RenderCopyExF(SDL_Renderer * renderer,
|
973
|
+
SDL_Texture * texture,
|
974
|
+
const SDL_Rect * srcrect,
|
975
|
+
const SDL_FRect * dstrect,
|
976
|
+
const double angle,
|
977
|
+
const SDL_FPoint *center,
|
978
|
+
const SDL_RendererFlip flip);
|
979
|
+
|
838
980
|
/**
|
839
981
|
* \brief Read pixels from the current rendering target.
|
840
982
|
*
|
@@ -876,6 +1018,31 @@ extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
|
|
876
1018
|
*/
|
877
1019
|
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
|
878
1020
|
|
1021
|
+
/**
|
1022
|
+
* \brief Force the rendering context to flush any pending commands to the
|
1023
|
+
* underlying rendering API.
|
1024
|
+
*
|
1025
|
+
* You do not need to (and in fact, shouldn't) call this function unless
|
1026
|
+
* you are planning to call into OpenGL/Direct3D/Metal/whatever directly
|
1027
|
+
* in addition to using an SDL_Renderer.
|
1028
|
+
*
|
1029
|
+
* This is for a very-specific case: if you are using SDL's render API,
|
1030
|
+
* you asked for a specific renderer backend (OpenGL, Direct3D, etc),
|
1031
|
+
* you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make
|
1032
|
+
* OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of
|
1033
|
+
* this applies, you should call SDL_RenderFlush() between calls to SDL's
|
1034
|
+
* render API and the low-level API you're using in cooperation.
|
1035
|
+
*
|
1036
|
+
* In all other cases, you can ignore this function. This is only here to
|
1037
|
+
* get maximum performance out of a specific situation. In all other cases,
|
1038
|
+
* SDL will do the right thing, perhaps at a performance loss.
|
1039
|
+
*
|
1040
|
+
* This function is first available in SDL 2.0.10, and is not needed in
|
1041
|
+
* 2.0.9 and earlier, as earlier versions did not queue rendering commands
|
1042
|
+
* at all, instead flushing them to the OS immediately.
|
1043
|
+
*/
|
1044
|
+
extern DECLSPEC int SDLCALL SDL_RenderFlush(SDL_Renderer * renderer);
|
1045
|
+
|
879
1046
|
|
880
1047
|
/**
|
881
1048
|
* \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
|