slouken@5145
|
1 |
/*
|
slouken@5535
|
2 |
Simple DirectMedia Layer
|
slouken@8149
|
3 |
Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
slouken@5145
|
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@5145
|
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@5145
|
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@5145
|
20 |
*/
|
slouken@5145
|
21 |
|
slouken@5145
|
22 |
/**
|
slouken@5145
|
23 |
* \file SDL_render.h
|
slouken@7191
|
24 |
*
|
slouken@5145
|
25 |
* Header file for SDL 2D rendering functions.
|
slouken@5164
|
26 |
*
|
slouken@5164
|
27 |
* This API supports the following features:
|
slouken@5164
|
28 |
* * single pixel points
|
slouken@5164
|
29 |
* * single pixel lines
|
slouken@5164
|
30 |
* * filled rectangles
|
slouken@5164
|
31 |
* * texture images
|
slouken@5164
|
32 |
*
|
slouken@5164
|
33 |
* The primitives may be drawn in opaque, blended, or additive modes.
|
slouken@5164
|
34 |
*
|
slouken@5164
|
35 |
* The texture images may be drawn in opaque, blended, or additive modes.
|
slouken@5164
|
36 |
* They can have an additional color tint or alpha modulation applied to
|
slouken@5164
|
37 |
* them, and may also be stretched with linear interpolation.
|
slouken@5164
|
38 |
*
|
slouken@5164
|
39 |
* This API is designed to accelerate simple 2D operations. You may
|
slouken@7542
|
40 |
* want more functionality such as polygons and particle effects and
|
slouken@5164
|
41 |
* in that case you should use SDL's OpenGL/Direct3D support or one
|
slouken@5164
|
42 |
* of the many good 3D engines.
|
slouken@7542
|
43 |
*
|
slouken@7542
|
44 |
* These functions must be called from the main thread.
|
slouken@7542
|
45 |
* See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995
|
slouken@5145
|
46 |
*/
|
slouken@5145
|
47 |
|
slouken@5145
|
48 |
#ifndef _SDL_render_h
|
slouken@5145
|
49 |
#define _SDL_render_h
|
slouken@5145
|
50 |
|
slouken@5145
|
51 |
#include "SDL_stdinc.h"
|
slouken@5145
|
52 |
#include "SDL_rect.h"
|
slouken@5145
|
53 |
#include "SDL_video.h"
|
slouken@5145
|
54 |
|
slouken@5145
|
55 |
#include "begin_code.h"
|
slouken@5145
|
56 |
/* Set up for C function definitions, even when using C++ */
|
slouken@5145
|
57 |
#ifdef __cplusplus
|
slouken@5145
|
58 |
extern "C" {
|
slouken@5145
|
59 |
#endif
|
slouken@5145
|
60 |
|
slouken@5145
|
61 |
/**
|
slouken@5145
|
62 |
* \brief Flags used when creating a rendering context
|
slouken@5145
|
63 |
*/
|
slouken@5145
|
64 |
typedef enum
|
slouken@5145
|
65 |
{
|
slouken@7191
|
66 |
SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */
|
slouken@7191
|
67 |
SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware
|
slouken@5145
|
68 |
acceleration */
|
slouken@7191
|
69 |
SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized
|
slouken@5145
|
70 |
with the refresh rate */
|
slouken@6237
|
71 |
SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports
|
slouken@6237
|
72 |
rendering to texture */
|
slouken@5145
|
73 |
} SDL_RendererFlags;
|
slouken@5145
|
74 |
|
slouken@5145
|
75 |
/**
|
slouken@5145
|
76 |
* \brief Information on the capabilities of a render driver or context.
|
slouken@5145
|
77 |
*/
|
slouken@5145
|
78 |
typedef struct SDL_RendererInfo
|
slouken@5145
|
79 |
{
|
slouken@5145
|
80 |
const char *name; /**< The name of the renderer */
|
slouken@5145
|
81 |
Uint32 flags; /**< Supported ::SDL_RendererFlags */
|
slouken@5145
|
82 |
Uint32 num_texture_formats; /**< The number of available texture formats */
|
slouken@5156
|
83 |
Uint32 texture_formats[16]; /**< The available texture formats */
|
philipp@9323
|
84 |
int max_texture_width; /**< The maximum texture width */
|
philipp@9323
|
85 |
int max_texture_height; /**< The maximum texture height */
|
slouken@5145
|
86 |
} SDL_RendererInfo;
|
slouken@5145
|
87 |
|
slouken@5145
|
88 |
/**
|
slouken@5145
|
89 |
* \brief The access pattern allowed for a texture.
|
slouken@5145
|
90 |
*/
|
slouken@5145
|
91 |
typedef enum
|
slouken@5145
|
92 |
{
|
slouken@5145
|
93 |
SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
|
slouken@6232
|
94 |
SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
|
slouken@6232
|
95 |
SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
|
slouken@5145
|
96 |
} SDL_TextureAccess;
|
slouken@5145
|
97 |
|
slouken@5145
|
98 |
/**
|
slouken@5145
|
99 |
* \brief The texture channel modulation used in SDL_RenderCopy().
|
slouken@5145
|
100 |
*/
|
slouken@5145
|
101 |
typedef enum
|
slouken@5145
|
102 |
{
|
slouken@5145
|
103 |
SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */
|
slouken@5145
|
104 |
SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */
|
slouken@5145
|
105 |
SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
|
slouken@5145
|
106 |
} SDL_TextureModulate;
|
slouken@5145
|
107 |
|
slouken@5145
|
108 |
/**
|
gabomdq@6320
|
109 |
* \brief Flip constants for SDL_RenderCopyEx
|
gabomdq@6320
|
110 |
*/
|
gabomdq@6320
|
111 |
typedef enum
|
gabomdq@6320
|
112 |
{
|
gabomdq@6320
|
113 |
SDL_FLIP_NONE = 0x00000000, /**< Do not flip */
|
gabomdq@6320
|
114 |
SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */
|
gabomdq@6320
|
115 |
SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */
|
gabomdq@6320
|
116 |
} SDL_RendererFlip;
|
gabomdq@6320
|
117 |
|
gabomdq@6320
|
118 |
/**
|
slouken@5147
|
119 |
* \brief A structure representing rendering state
|
slouken@5147
|
120 |
*/
|
slouken@5147
|
121 |
struct SDL_Renderer;
|
slouken@5147
|
122 |
typedef struct SDL_Renderer SDL_Renderer;
|
slouken@5147
|
123 |
|
slouken@5147
|
124 |
/**
|
slouken@5145
|
125 |
* \brief An efficient driver-specific representation of pixel data
|
slouken@5145
|
126 |
*/
|
slouken@5145
|
127 |
struct SDL_Texture;
|
slouken@5145
|
128 |
typedef struct SDL_Texture SDL_Texture;
|
slouken@5145
|
129 |
|
slouken@5145
|
130 |
|
slouken@5145
|
131 |
/* Function prototypes */
|
slouken@5145
|
132 |
|
slouken@5145
|
133 |
/**
|
slouken@7191
|
134 |
* \brief Get the number of 2D rendering drivers available for the current
|
slouken@5145
|
135 |
* display.
|
slouken@7191
|
136 |
*
|
slouken@5145
|
137 |
* A render driver is a set of code that handles rendering and texture
|
slouken@5145
|
138 |
* management on a particular display. Normally there is only one, but
|
slouken@5145
|
139 |
* some drivers may have several available with different capabilities.
|
slouken@7191
|
140 |
*
|
slouken@5145
|
141 |
* \sa SDL_GetRenderDriverInfo()
|
slouken@5145
|
142 |
* \sa SDL_CreateRenderer()
|
slouken@5145
|
143 |
*/
|
slouken@5145
|
144 |
extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
|
slouken@5145
|
145 |
|
slouken@5145
|
146 |
/**
|
slouken@7191
|
147 |
* \brief Get information about a specific 2D rendering driver for the current
|
slouken@5145
|
148 |
* display.
|
slouken@7191
|
149 |
*
|
slouken@5145
|
150 |
* \param index The index of the driver to query information about.
|
slouken@7191
|
151 |
* \param info A pointer to an SDL_RendererInfo struct to be filled with
|
slouken@5145
|
152 |
* information on the rendering driver.
|
slouken@7191
|
153 |
*
|
slouken@5145
|
154 |
* \return 0 on success, -1 if the index was out of range.
|
slouken@7191
|
155 |
*
|
slouken@5145
|
156 |
* \sa SDL_CreateRenderer()
|
slouken@5145
|
157 |
*/
|
slouken@5145
|
158 |
extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
|
slouken@5145
|
159 |
SDL_RendererInfo * info);
|
slouken@5145
|
160 |
|
slouken@5145
|
161 |
/**
|
slouken@6258
|
162 |
* \brief Create a window and default renderer
|
slouken@6258
|
163 |
*
|
slouken@6258
|
164 |
* \param width The width of the window
|
slouken@6258
|
165 |
* \param height The height of the window
|
slouken@6258
|
166 |
* \param window_flags The flags used to create the window
|
slouken@6258
|
167 |
* \param window A pointer filled with the window, or NULL on error
|
slouken@6258
|
168 |
* \param renderer A pointer filled with the renderer, or NULL on error
|
slouken@6258
|
169 |
*
|
slouken@6258
|
170 |
* \return 0 on success, or -1 on error
|
slouken@6258
|
171 |
*/
|
slouken@6258
|
172 |
extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(
|
slouken@6258
|
173 |
int width, int height, Uint32 window_flags,
|
slouken@6258
|
174 |
SDL_Window **window, SDL_Renderer **renderer);
|
slouken@6258
|
175 |
|
slouken@6258
|
176 |
|
slouken@6258
|
177 |
/**
|
slouken@5147
|
178 |
* \brief Create a 2D rendering context for a window.
|
slouken@7191
|
179 |
*
|
slouken@5145
|
180 |
* \param window The window where rendering is displayed.
|
slouken@7191
|
181 |
* \param index The index of the rendering driver to initialize, or -1 to
|
slouken@5145
|
182 |
* initialize the first one supporting the requested flags.
|
slouken@5145
|
183 |
* \param flags ::SDL_RendererFlags.
|
slouken@7191
|
184 |
*
|
slouken@5147
|
185 |
* \return A valid rendering context or NULL if there was an error.
|
slouken@7191
|
186 |
*
|
slouken@5166
|
187 |
* \sa SDL_CreateSoftwareRenderer()
|
slouken@5145
|
188 |
* \sa SDL_GetRendererInfo()
|
slouken@5145
|
189 |
* \sa SDL_DestroyRenderer()
|
slouken@5145
|
190 |
*/
|
slouken@5147
|
191 |
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
|
slouken@5145
|
192 |
int index, Uint32 flags);
|
slouken@5145
|
193 |
|
slouken@5145
|
194 |
/**
|
slouken@5166
|
195 |
* \brief Create a 2D software rendering context for a surface.
|
slouken@7191
|
196 |
*
|
slouken@5166
|
197 |
* \param surface The surface where rendering is done.
|
slouken@7191
|
198 |
*
|
slouken@5166
|
199 |
* \return A valid rendering context or NULL if there was an error.
|
slouken@7191
|
200 |
*
|
slouken@5166
|
201 |
* \sa SDL_CreateRenderer()
|
slouken@5166
|
202 |
* \sa SDL_DestroyRenderer()
|
slouken@5166
|
203 |
*/
|
slouken@5166
|
204 |
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
|
slouken@5166
|
205 |
|
slouken@5166
|
206 |
/**
|
slouken@5528
|
207 |
* \brief Get the renderer associated with a window.
|
slouken@5528
|
208 |
*/
|
slouken@5528
|
209 |
extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
|
slouken@5528
|
210 |
|
slouken@5528
|
211 |
/**
|
slouken@5147
|
212 |
* \brief Get information about a rendering context.
|
slouken@5145
|
213 |
*/
|
slouken@5147
|
214 |
extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
|
slouken@5147
|
215 |
SDL_RendererInfo * info);
|
slouken@5145
|
216 |
|
slouken@5145
|
217 |
/**
|
slouken@7239
|
218 |
* \brief Get the output size of a rendering context.
|
slouken@7239
|
219 |
*/
|
slouken@7239
|
220 |
extern DECLSPEC int SDLCALL SDL_GetRendererOutputSize(SDL_Renderer * renderer,
|
slouken@7239
|
221 |
int *w, int *h);
|
slouken@7239
|
222 |
|
slouken@7239
|
223 |
/**
|
slouken@5147
|
224 |
* \brief Create a texture for a rendering context.
|
slouken@7191
|
225 |
*
|
philipp@7188
|
226 |
* \param renderer The renderer.
|
slouken@5145
|
227 |
* \param format The format of the texture.
|
slouken@5145
|
228 |
* \param access One of the enumerated values in ::SDL_TextureAccess.
|
slouken@5145
|
229 |
* \param w The width of the texture in pixels.
|
slouken@5145
|
230 |
* \param h The height of the texture in pixels.
|
slouken@7191
|
231 |
*
|
slouken@7191
|
232 |
* \return The created texture is returned, or 0 if no rendering context was
|
slouken@5145
|
233 |
* active, the format was unsupported, or the width or height were out
|
slouken@5145
|
234 |
* of range.
|
slouken@7191
|
235 |
*
|
slouken@5145
|
236 |
* \sa SDL_QueryTexture()
|
slouken@5216
|
237 |
* \sa SDL_UpdateTexture()
|
slouken@5145
|
238 |
* \sa SDL_DestroyTexture()
|
slouken@5145
|
239 |
*/
|
slouken@5344
|
240 |
extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,
|
slouken@5344
|
241 |
Uint32 format,
|
slouken@5145
|
242 |
int access, int w,
|
slouken@5145
|
243 |
int h);
|
slouken@5145
|
244 |
|
slouken@5145
|
245 |
/**
|
slouken@5145
|
246 |
* \brief Create a texture from an existing surface.
|
slouken@7191
|
247 |
*
|
philipp@7188
|
248 |
* \param renderer The renderer.
|
slouken@5145
|
249 |
* \param surface The surface containing pixel data used to fill the texture.
|
slouken@7191
|
250 |
*
|
slouken@5158
|
251 |
* \return The created texture is returned, or 0 on error.
|
slouken@7191
|
252 |
*
|
slouken@5145
|
253 |
* \note The surface is not modified or freed by this function.
|
slouken@7191
|
254 |
*
|
slouken@5145
|
255 |
* \sa SDL_QueryTexture()
|
slouken@5145
|
256 |
* \sa SDL_DestroyTexture()
|
slouken@5145
|
257 |
*/
|
slouken@5158
|
258 |
extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
|
slouken@5145
|
259 |
|
slouken@5145
|
260 |
/**
|
slouken@5145
|
261 |
* \brief Query the attributes of a texture
|
slouken@7191
|
262 |
*
|
slouken@5145
|
263 |
* \param texture A texture to be queried.
|
slouken@7191
|
264 |
* \param format A pointer filled in with the raw format of the texture. The
|
slouken@7191
|
265 |
* actual format may differ, but pixel transfers will use this
|
slouken@5145
|
266 |
* format.
|
slouken@5145
|
267 |
* \param access A pointer filled in with the actual access to the texture.
|
slouken@5145
|
268 |
* \param w A pointer filled in with the width of the texture in pixels.
|
slouken@5145
|
269 |
* \param h A pointer filled in with the height of the texture in pixels.
|
slouken@7191
|
270 |
*
|
slouken@5145
|
271 |
* \return 0 on success, or -1 if the texture is not valid.
|
slouken@5145
|
272 |
*/
|
slouken@5145
|
273 |
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
|
slouken@5145
|
274 |
Uint32 * format, int *access,
|
slouken@5145
|
275 |
int *w, int *h);
|
slouken@5145
|
276 |
|
slouken@5145
|
277 |
/**
|
slouken@5145
|
278 |
* \brief Set an additional color value used in render copy operations.
|
slouken@7191
|
279 |
*
|
slouken@5145
|
280 |
* \param texture The texture to update.
|
slouken@5145
|
281 |
* \param r The red color value multiplied into copy operations.
|
slouken@5145
|
282 |
* \param g The green color value multiplied into copy operations.
|
slouken@5145
|
283 |
* \param b The blue color value multiplied into copy operations.
|
slouken@7191
|
284 |
*
|
slouken@7191
|
285 |
* \return 0 on success, or -1 if the texture is not valid or color modulation
|
slouken@5145
|
286 |
* is not supported.
|
slouken@7191
|
287 |
*
|
slouken@5145
|
288 |
* \sa SDL_GetTextureColorMod()
|
slouken@5145
|
289 |
*/
|
slouken@5145
|
290 |
extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
|
slouken@5145
|
291 |
Uint8 r, Uint8 g, Uint8 b);
|
slouken@5145
|
292 |
|
slouken@5145
|
293 |
|
slouken@5145
|
294 |
/**
|
slouken@5145
|
295 |
* \brief Get the additional color value used in render copy operations.
|
slouken@7191
|
296 |
*
|
slouken@5145
|
297 |
* \param texture The texture to query.
|
slouken@5145
|
298 |
* \param r A pointer filled in with the current red color value.
|
slouken@5145
|
299 |
* \param g A pointer filled in with the current green color value.
|
slouken@5145
|
300 |
* \param b A pointer filled in with the current blue color value.
|
slouken@7191
|
301 |
*
|
slouken@5145
|
302 |
* \return 0 on success, or -1 if the texture is not valid.
|
slouken@7191
|
303 |
*
|
slouken@5145
|
304 |
* \sa SDL_SetTextureColorMod()
|
slouken@5145
|
305 |
*/
|
slouken@5145
|
306 |
extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
|
slouken@5145
|
307 |
Uint8 * r, Uint8 * g,
|
slouken@5145
|
308 |
Uint8 * b);
|
slouken@5145
|
309 |
|
slouken@5145
|
310 |
/**
|
slouken@5145
|
311 |
* \brief Set an additional alpha value used in render copy operations.
|
slouken@7191
|
312 |
*
|
slouken@5145
|
313 |
* \param texture The texture to update.
|
slouken@5145
|
314 |
* \param alpha The alpha value multiplied into copy operations.
|
slouken@7191
|
315 |
*
|
slouken@7191
|
316 |
* \return 0 on success, or -1 if the texture is not valid or alpha modulation
|
slouken@5145
|
317 |
* is not supported.
|
slouken@7191
|
318 |
*
|
slouken@5145
|
319 |
* \sa SDL_GetTextureAlphaMod()
|
slouken@5145
|
320 |
*/
|
slouken@5145
|
321 |
extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
|
slouken@5145
|
322 |
Uint8 alpha);
|
slouken@5145
|
323 |
|
slouken@5145
|
324 |
/**
|
slouken@5145
|
325 |
* \brief Get the additional alpha value used in render copy operations.
|
slouken@7191
|
326 |
*
|
slouken@5145
|
327 |
* \param texture The texture to query.
|
slouken@5145
|
328 |
* \param alpha A pointer filled in with the current alpha value.
|
slouken@7191
|
329 |
*
|
slouken@5145
|
330 |
* \return 0 on success, or -1 if the texture is not valid.
|
slouken@7191
|
331 |
*
|
slouken@5145
|
332 |
* \sa SDL_SetTextureAlphaMod()
|
slouken@5145
|
333 |
*/
|
slouken@5145
|
334 |
extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
|
slouken@5145
|
335 |
Uint8 * alpha);
|
slouken@5145
|
336 |
|
slouken@5145
|
337 |
/**
|
slouken@5145
|
338 |
* \brief Set the blend mode used for texture copy operations.
|
slouken@7191
|
339 |
*
|
slouken@5145
|
340 |
* \param texture The texture to update.
|
slouken@5145
|
341 |
* \param blendMode ::SDL_BlendMode to use for texture blending.
|
slouken@7191
|
342 |
*
|
slouken@5145
|
343 |
* \return 0 on success, or -1 if the texture is not valid or the blend mode is
|
slouken@5145
|
344 |
* not supported.
|
slouken@7191
|
345 |
*
|
slouken@5145
|
346 |
* \note If the blend mode is not supported, the closest supported mode is
|
slouken@5145
|
347 |
* chosen.
|
slouken@7191
|
348 |
*
|
slouken@5145
|
349 |
* \sa SDL_GetTextureBlendMode()
|
slouken@5145
|
350 |
*/
|
slouken@5145
|
351 |
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
|
slouken@5145
|
352 |
SDL_BlendMode blendMode);
|
slouken@5145
|
353 |
|
slouken@5145
|
354 |
/**
|
slouken@5145
|
355 |
* \brief Get the blend mode used for texture copy operations.
|
slouken@7191
|
356 |
*
|
slouken@5156
|
357 |
* \param texture The texture to query.
|
slouken@5145
|
358 |
* \param blendMode A pointer filled in with the current blend mode.
|
slouken@7191
|
359 |
*
|
slouken@5145
|
360 |
* \return 0 on success, or -1 if the texture is not valid.
|
slouken@7191
|
361 |
*
|
slouken@5145
|
362 |
* \sa SDL_SetTextureBlendMode()
|
slouken@5145
|
363 |
*/
|
slouken@5145
|
364 |
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
|
slouken@5145
|
365 |
SDL_BlendMode *blendMode);
|
slouken@5145
|
366 |
|
slouken@5145
|
367 |
/**
|
slouken@5145
|
368 |
* \brief Update the given texture rectangle with new pixel data.
|
slouken@7191
|
369 |
*
|
slouken@5156
|
370 |
* \param texture The texture to update
|
slouken@7191
|
371 |
* \param rect A pointer to the rectangle of pixels to update, or NULL to
|
slouken@5145
|
372 |
* update the entire texture.
|
slouken@5145
|
373 |
* \param pixels The raw pixel data.
|
slouken@9248
|
374 |
* \param pitch The number of bytes in a row of pixel data, including padding between lines.
|
slouken@7191
|
375 |
*
|
slouken@5145
|
376 |
* \return 0 on success, or -1 if the texture is not valid.
|
slouken@7191
|
377 |
*
|
slouken@5145
|
378 |
* \note This is a fairly slow function.
|
slouken@5145
|
379 |
*/
|
slouken@5145
|
380 |
extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
|
slouken@5145
|
381 |
const SDL_Rect * rect,
|
slouken@5145
|
382 |
const void *pixels, int pitch);
|
slouken@5145
|
383 |
|
slouken@5145
|
384 |
/**
|
slouken@7759
|
385 |
* \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
|
slouken@7759
|
386 |
*
|
slouken@7759
|
387 |
* \param texture The texture to update
|
slouken@7759
|
388 |
* \param rect A pointer to the rectangle of pixels to update, or NULL to
|
slouken@7759
|
389 |
* update the entire texture.
|
slouken@7759
|
390 |
* \param Yplane The raw pixel data for the Y plane.
|
slouken@7759
|
391 |
* \param Ypitch The number of bytes between rows of pixel data for the Y plane.
|
slouken@7759
|
392 |
* \param Uplane The raw pixel data for the U plane.
|
slouken@7759
|
393 |
* \param Upitch The number of bytes between rows of pixel data for the U plane.
|
slouken@7759
|
394 |
* \param Vplane The raw pixel data for the V plane.
|
slouken@7759
|
395 |
* \param Vpitch The number of bytes between rows of pixel data for the V plane.
|
slouken@7759
|
396 |
*
|
slouken@7759
|
397 |
* \return 0 on success, or -1 if the texture is not valid.
|
slouken@7759
|
398 |
*
|
slouken@7759
|
399 |
* \note You can use SDL_UpdateTexture() as long as your pixel data is
|
slouken@7759
|
400 |
* a contiguous block of Y and U/V planes in the proper order, but
|
slouken@7759
|
401 |
* this function is available if your pixel data is not contiguous.
|
slouken@7759
|
402 |
*/
|
slouken@7759
|
403 |
extern DECLSPEC int SDLCALL SDL_UpdateYUVTexture(SDL_Texture * texture,
|
slouken@7759
|
404 |
const SDL_Rect * rect,
|
slouken@7759
|
405 |
const Uint8 *Yplane, int Ypitch,
|
slouken@7759
|
406 |
const Uint8 *Uplane, int Upitch,
|
slouken@7759
|
407 |
const Uint8 *Vplane, int Vpitch);
|
slouken@7759
|
408 |
|
slouken@7759
|
409 |
/**
|
slouken@6493
|
410 |
* \brief Lock a portion of the texture for write-only pixel access.
|
slouken@7191
|
411 |
*
|
slouken@7191
|
412 |
* \param texture The texture to lock for access, which was created with
|
slouken@5145
|
413 |
* ::SDL_TEXTUREACCESS_STREAMING.
|
slouken@7191
|
414 |
* \param rect A pointer to the rectangle to lock for access. If the rect
|
slouken@5145
|
415 |
* is NULL, the entire texture will be locked.
|
slouken@7191
|
416 |
* \param pixels This is filled in with a pointer to the locked pixels,
|
slouken@5145
|
417 |
* appropriately offset by the locked area.
|
slouken@5145
|
418 |
* \param pitch This is filled in with the pitch of the locked pixels.
|
slouken@7191
|
419 |
*
|
slouken@5156
|
420 |
* \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
|
slouken@7191
|
421 |
*
|
slouken@5145
|
422 |
* \sa SDL_UnlockTexture()
|
slouken@5145
|
423 |
*/
|
slouken@5145
|
424 |
extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
|
slouken@5145
|
425 |
const SDL_Rect * rect,
|
slouken@5156
|
426 |
void **pixels, int *pitch);
|
slouken@5145
|
427 |
|
slouken@5145
|
428 |
/**
|
slouken@5156
|
429 |
* \brief Unlock a texture, uploading the changes to video memory, if needed.
|
slouken@7191
|
430 |
*
|
slouken@5145
|
431 |
* \sa SDL_LockTexture()
|
slouken@5145
|
432 |
*/
|
slouken@5156
|
433 |
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
|
slouken@5145
|
434 |
|
slouken@5145
|
435 |
/**
|
slouken@6247
|
436 |
* \brief Determines whether a window supports the use of render targets
|
slouken@6247
|
437 |
*
|
slouken@6247
|
438 |
* \param renderer The renderer that will be checked
|
slouken@6247
|
439 |
*
|
slouken@6247
|
440 |
* \return SDL_TRUE if supported, SDL_FALSE if not.
|
slouken@6247
|
441 |
*/
|
slouken@6247
|
442 |
extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
|
slouken@6247
|
443 |
|
slouken@6247
|
444 |
/**
|
slouken@6247
|
445 |
* \brief Set a texture as the current rendering target.
|
slouken@6247
|
446 |
*
|
philipp@7188
|
447 |
* \param renderer The renderer.
|
slouken@6248
|
448 |
* \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
|
slouken@6247
|
449 |
*
|
slouken@6247
|
450 |
* \return 0 on success, or -1 on error
|
slouken@6578
|
451 |
*
|
slouken@6578
|
452 |
* \sa SDL_GetRenderTarget()
|
slouken@6247
|
453 |
*/
|
slouken@6247
|
454 |
extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
|
slouken@6247
|
455 |
SDL_Texture *texture);
|
slouken@6247
|
456 |
|
slouken@6247
|
457 |
/**
|
slouken@6578
|
458 |
* \brief Get the current render target or NULL for the default render target.
|
slouken@6578
|
459 |
*
|
slouken@6578
|
460 |
* \return The current render target
|
slouken@6578
|
461 |
*
|
slouken@6578
|
462 |
* \sa SDL_SetRenderTarget()
|
slouken@6578
|
463 |
*/
|
slouken@6578
|
464 |
extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
|
slouken@6578
|
465 |
|
slouken@6578
|
466 |
/**
|
slouken@6530
|
467 |
* \brief Set device independent resolution for rendering
|
slouken@6530
|
468 |
*
|
philipp@7188
|
469 |
* \param renderer The renderer for which resolution should be set.
|
slouken@6530
|
470 |
* \param w The width of the logical resolution
|
slouken@6530
|
471 |
* \param h The height of the logical resolution
|
slouken@6530
|
472 |
*
|
slouken@6530
|
473 |
* This function uses the viewport and scaling functionality to allow a fixed logical
|
slouken@6530
|
474 |
* resolution for rendering, regardless of the actual output resolution. If the actual
|
slouken@6530
|
475 |
* output resolution doesn't have the same aspect ratio the output rendering will be
|
slouken@6530
|
476 |
* centered within the output display.
|
slouken@6530
|
477 |
*
|
slouken@6530
|
478 |
* If the output display is a window, mouse events in the window will be filtered
|
slouken@6530
|
479 |
* and scaled so they seem to arrive within the logical resolution.
|
slouken@6530
|
480 |
*
|
slouken@7191
|
481 |
* \note If this function results in scaling or subpixel drawing by the
|
slouken@6530
|
482 |
* rendering backend, it will be handled using the appropriate
|
slouken@6530
|
483 |
* quality hints.
|
slouken@6530
|
484 |
*
|
slouken@6530
|
485 |
* \sa SDL_RenderGetLogicalSize()
|
slouken@6530
|
486 |
* \sa SDL_RenderSetScale()
|
slouken@6530
|
487 |
* \sa SDL_RenderSetViewport()
|
slouken@6530
|
488 |
*/
|
slouken@6530
|
489 |
extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
|
slouken@6530
|
490 |
|
slouken@6530
|
491 |
/**
|
slouken@6530
|
492 |
* \brief Get device independent resolution for rendering
|
slouken@6530
|
493 |
*
|
philipp@7188
|
494 |
* \param renderer The renderer from which resolution should be queried.
|
slouken@6530
|
495 |
* \param w A pointer filled with the width of the logical resolution
|
slouken@6530
|
496 |
* \param h A pointer filled with the height of the logical resolution
|
slouken@6530
|
497 |
*
|
slouken@6530
|
498 |
* \sa SDL_RenderSetLogicalSize()
|
slouken@6530
|
499 |
*/
|
philipp@7175
|
500 |
extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *h);
|
slouken@6530
|
501 |
|
slouken@6530
|
502 |
/**
|
slouken@5297
|
503 |
* \brief Set the drawing area for rendering on the current target.
|
slouken@5224
|
504 |
*
|
philipp@7188
|
505 |
* \param renderer The renderer for which the drawing area should be set.
|
slouken@5297
|
506 |
* \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
|
slouken@5297
|
507 |
*
|
slouken@5297
|
508 |
* The x,y of the viewport rect represents the origin for rendering.
|
slouken@5224
|
509 |
*
|
slouken@7141
|
510 |
* \return 0 on success, or -1 on error
|
slouken@7141
|
511 |
*
|
slouken@7240
|
512 |
* \note If the window associated with the renderer is resized, the viewport is automatically reset.
|
slouken@6530
|
513 |
*
|
slouken@6530
|
514 |
* \sa SDL_RenderGetViewport()
|
slouken@6530
|
515 |
* \sa SDL_RenderSetLogicalSize()
|
slouken@5224
|
516 |
*/
|
slouken@5297
|
517 |
extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
|
slouken@5297
|
518 |
const SDL_Rect * rect);
|
slouken@5297
|
519 |
|
slouken@5297
|
520 |
/**
|
slouken@5297
|
521 |
* \brief Get the drawing area for the current target.
|
slouken@6530
|
522 |
*
|
slouken@6530
|
523 |
* \sa SDL_RenderSetViewport()
|
slouken@5297
|
524 |
*/
|
slouken@5297
|
525 |
extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
|
slouken@5297
|
526 |
SDL_Rect * rect);
|
slouken@5224
|
527 |
|
slouken@5224
|
528 |
/**
|
slouken@7141
|
529 |
* \brief Set the clip rectangle for the current target.
|
slouken@7191
|
530 |
*
|
philipp@7188
|
531 |
* \param renderer The renderer for which clip rectangle should be set.
|
slouken@7141
|
532 |
* \param rect A pointer to the rectangle to set as the clip rectangle, or
|
slouken@7141
|
533 |
* NULL to disable clipping.
|
slouken@7141
|
534 |
*
|
slouken@7141
|
535 |
* \return 0 on success, or -1 on error
|
slouken@7141
|
536 |
*
|
slouken@7141
|
537 |
* \sa SDL_RenderGetClipRect()
|
slouken@7141
|
538 |
*/
|
slouken@7141
|
539 |
extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
|
slouken@7141
|
540 |
const SDL_Rect * rect);
|
slouken@7141
|
541 |
|
slouken@7141
|
542 |
/**
|
slouken@7141
|
543 |
* \brief Get the clip rectangle for the current target.
|
slouken@7191
|
544 |
*
|
philipp@7188
|
545 |
* \param renderer The renderer from which clip rectangle should be queried.
|
slouken@7141
|
546 |
* \param rect A pointer filled in with the current clip rectangle, or
|
slouken@7141
|
547 |
* an empty rectangle if clipping is disabled.
|
slouken@7141
|
548 |
*
|
slouken@7141
|
549 |
* \sa SDL_RenderSetClipRect()
|
slouken@7141
|
550 |
*/
|
slouken@7141
|
551 |
extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer,
|
slouken@7141
|
552 |
SDL_Rect * rect);
|
slouken@7141
|
553 |
|
slouken@7141
|
554 |
/**
|
philipp@9199
|
555 |
* \brief Get whether clipping is enabled on the given renderer.
|
jorgenpt@8728
|
556 |
*
|
jorgenpt@8728
|
557 |
* \param renderer The renderer from which clip state should be queried.
|
jorgenpt@8728
|
558 |
*
|
jorgenpt@8728
|
559 |
* \sa SDL_RenderGetClipRect()
|
jorgenpt@8728
|
560 |
*/
|
jorgenpt@8728
|
561 |
extern DECLSPEC SDL_bool SDLCALL SDL_RenderIsClipEnabled(SDL_Renderer * renderer);
|
jorgenpt@8728
|
562 |
|
jorgenpt@8728
|
563 |
|
jorgenpt@8728
|
564 |
/**
|
slouken@6528
|
565 |
* \brief Set the drawing scale for rendering on the current target.
|
slouken@6528
|
566 |
*
|
philipp@7188
|
567 |
* \param renderer The renderer for which the drawing scale should be set.
|
slouken@6528
|
568 |
* \param scaleX The horizontal scaling factor
|
slouken@6528
|
569 |
* \param scaleY The vertical scaling factor
|
slouken@6528
|
570 |
*
|
slouken@6528
|
571 |
* The drawing coordinates are scaled by the x/y scaling factors
|
slouken@6528
|
572 |
* before they are used by the renderer. This allows resolution
|
slouken@6528
|
573 |
* independent drawing with a single coordinate system.
|
slouken@6528
|
574 |
*
|
slouken@7191
|
575 |
* \note If this results in scaling or subpixel drawing by the
|
slouken@6528
|
576 |
* rendering backend, it will be handled using the appropriate
|
slouken@6528
|
577 |
* quality hints. For best results use integer scaling factors.
|
slouken@6530
|
578 |
*
|
slouken@6530
|
579 |
* \sa SDL_RenderGetScale()
|
slouken@6530
|
580 |
* \sa SDL_RenderSetLogicalSize()
|
slouken@6528
|
581 |
*/
|
slouken@6528
|
582 |
extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer,
|
slouken@6528
|
583 |
float scaleX, float scaleY);
|
slouken@6528
|
584 |
|
slouken@6528
|
585 |
/**
|
slouken@6528
|
586 |
* \brief Get the drawing scale for the current target.
|
slouken@6528
|
587 |
*
|
philipp@7188
|
588 |
* \param renderer The renderer from which drawing scale should be queried.
|
slouken@6528
|
589 |
* \param scaleX A pointer filled in with the horizontal scaling factor
|
slouken@6528
|
590 |
* \param scaleY A pointer filled in with the vertical scaling factor
|
slouken@6530
|
591 |
*
|
slouken@6530
|
592 |
* \sa SDL_RenderSetScale()
|
slouken@6528
|
593 |
*/
|
slouken@6528
|
594 |
extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer,
|
slouken@6528
|
595 |
float *scaleX, float *scaleY);
|
slouken@6528
|
596 |
|
slouken@6528
|
597 |
/**
|
slouken@6039
|
598 |
* \brief Set the color used for drawing operations (Rect, Line and Clear).
|
slouken@7191
|
599 |
*
|
philipp@7188
|
600 |
* \param renderer The renderer for which drawing color should be set.
|
slouken@5145
|
601 |
* \param r The red value used to draw on the rendering target.
|
slouken@5145
|
602 |
* \param g The green value used to draw on the rendering target.
|
slouken@5145
|
603 |
* \param b The blue value used to draw on the rendering target.
|
slouken@7191
|
604 |
* \param a The alpha value used to draw on the rendering target, usually
|
slouken@5145
|
605 |
* ::SDL_ALPHA_OPAQUE (255).
|
slouken@7191
|
606 |
*
|
slouken@5147
|
607 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
608 |
*/
|
icculus@8028
|
609 |
extern DECLSPEC int SDLCALL SDL_SetRenderDrawColor(SDL_Renderer * renderer,
|
slouken@5147
|
610 |
Uint8 r, Uint8 g, Uint8 b,
|
slouken@5145
|
611 |
Uint8 a);
|
slouken@5145
|
612 |
|
slouken@5145
|
613 |
/**
|
slouken@6039
|
614 |
* \brief Get the color used for drawing operations (Rect, Line and Clear).
|
slouken@7191
|
615 |
*
|
philipp@7188
|
616 |
* \param renderer The renderer from which drawing color should be queried.
|
slouken@5145
|
617 |
* \param r A pointer to the red value used to draw on the rendering target.
|
slouken@5145
|
618 |
* \param g A pointer to the green value used to draw on the rendering target.
|
slouken@5145
|
619 |
* \param b A pointer to the blue value used to draw on the rendering target.
|
slouken@7191
|
620 |
* \param a A pointer to the alpha value used to draw on the rendering target,
|
slouken@5145
|
621 |
* usually ::SDL_ALPHA_OPAQUE (255).
|
slouken@7191
|
622 |
*
|
slouken@5147
|
623 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
624 |
*/
|
icculus@8028
|
625 |
extern DECLSPEC int SDLCALL SDL_GetRenderDrawColor(SDL_Renderer * renderer,
|
slouken@5147
|
626 |
Uint8 * r, Uint8 * g, Uint8 * b,
|
slouken@5145
|
627 |
Uint8 * a);
|
slouken@5145
|
628 |
|
slouken@5145
|
629 |
/**
|
slouken@5145
|
630 |
* \brief Set the blend mode used for drawing operations (Fill and Line).
|
slouken@7191
|
631 |
*
|
philipp@7188
|
632 |
* \param renderer The renderer for which blend mode should be set.
|
slouken@5145
|
633 |
* \param blendMode ::SDL_BlendMode to use for blending.
|
slouken@7191
|
634 |
*
|
slouken@5147
|
635 |
* \return 0 on success, or -1 on error
|
slouken@7191
|
636 |
*
|
slouken@7191
|
637 |
* \note If the blend mode is not supported, the closest supported mode is
|
slouken@5145
|
638 |
* chosen.
|
slouken@7191
|
639 |
*
|
slouken@5145
|
640 |
* \sa SDL_GetRenderDrawBlendMode()
|
slouken@5145
|
641 |
*/
|
slouken@5147
|
642 |
extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
|
slouken@5147
|
643 |
SDL_BlendMode blendMode);
|
slouken@5145
|
644 |
|
slouken@5145
|
645 |
/**
|
slouken@5145
|
646 |
* \brief Get the blend mode used for drawing operations.
|
slouken@7191
|
647 |
*
|
philipp@7188
|
648 |
* \param renderer The renderer from which blend mode should be queried.
|
slouken@5145
|
649 |
* \param blendMode A pointer filled in with the current blend mode.
|
slouken@7191
|
650 |
*
|
slouken@5147
|
651 |
* \return 0 on success, or -1 on error
|
slouken@7191
|
652 |
*
|
slouken@5145
|
653 |
* \sa SDL_SetRenderDrawBlendMode()
|
slouken@5145
|
654 |
*/
|
slouken@5147
|
655 |
extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
|
slouken@5147
|
656 |
SDL_BlendMode *blendMode);
|
slouken@5145
|
657 |
|
slouken@5145
|
658 |
/**
|
slouken@5145
|
659 |
* \brief Clear the current rendering target with the drawing color
|
slouken@5297
|
660 |
*
|
slouken@5297
|
661 |
* This function clears the entire rendering target, ignoring the viewport.
|
philipp@7168
|
662 |
*
|
philipp@7168
|
663 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
664 |
*/
|
slouken@5147
|
665 |
extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
|
slouken@5145
|
666 |
|
slouken@5145
|
667 |
/**
|
slouken@5145
|
668 |
* \brief Draw a point on the current rendering target.
|
slouken@7191
|
669 |
*
|
philipp@7188
|
670 |
* \param renderer The renderer which should draw a point.
|
slouken@5145
|
671 |
* \param x The x coordinate of the point.
|
slouken@5145
|
672 |
* \param y The y coordinate of the point.
|
slouken@7191
|
673 |
*
|
slouken@5147
|
674 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
675 |
*/
|
slouken@5147
|
676 |
extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
|
slouken@5147
|
677 |
int x, int y);
|
slouken@5145
|
678 |
|
slouken@5145
|
679 |
/**
|
slouken@5145
|
680 |
* \brief Draw multiple points on the current rendering target.
|
slouken@7191
|
681 |
*
|
philipp@7188
|
682 |
* \param renderer The renderer which should draw multiple points.
|
slouken@5145
|
683 |
* \param points The points to draw
|
slouken@5145
|
684 |
* \param count The number of points to draw
|
slouken@7191
|
685 |
*
|
slouken@5147
|
686 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
687 |
*/
|
slouken@5147
|
688 |
extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
|
slouken@5147
|
689 |
const SDL_Point * points,
|
slouken@5145
|
690 |
int count);
|
slouken@5145
|
691 |
|
slouken@5145
|
692 |
/**
|
slouken@5145
|
693 |
* \brief Draw a line on the current rendering target.
|
slouken@7191
|
694 |
*
|
philipp@7188
|
695 |
* \param renderer The renderer which should draw a line.
|
slouken@5145
|
696 |
* \param x1 The x coordinate of the start point.
|
slouken@5145
|
697 |
* \param y1 The y coordinate of the start point.
|
slouken@5145
|
698 |
* \param x2 The x coordinate of the end point.
|
slouken@5145
|
699 |
* \param y2 The y coordinate of the end point.
|
slouken@7191
|
700 |
*
|
slouken@5147
|
701 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
702 |
*/
|
slouken@5147
|
703 |
extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
|
slouken@5147
|
704 |
int x1, int y1, int x2, int y2);
|
slouken@5145
|
705 |
|
slouken@5145
|
706 |
/**
|
slouken@5145
|
707 |
* \brief Draw a series of connected lines on the current rendering target.
|
slouken@7191
|
708 |
*
|
philipp@7188
|
709 |
* \param renderer The renderer which should draw multiple lines.
|
slouken@5145
|
710 |
* \param points The points along the lines
|
slouken@5145
|
711 |
* \param count The number of points, drawing count-1 lines
|
slouken@7191
|
712 |
*
|
slouken@5147
|
713 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
714 |
*/
|
slouken@5147
|
715 |
extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
|
slouken@5147
|
716 |
const SDL_Point * points,
|
slouken@5145
|
717 |
int count);
|
slouken@5145
|
718 |
|
slouken@5145
|
719 |
/**
|
slouken@5145
|
720 |
* \brief Draw a rectangle on the current rendering target.
|
slouken@7191
|
721 |
*
|
philipp@7188
|
722 |
* \param renderer The renderer which should draw a rectangle.
|
slouken@5145
|
723 |
* \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
|
slouken@7191
|
724 |
*
|
slouken@5147
|
725 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
726 |
*/
|
slouken@5147
|
727 |
extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
|
slouken@5147
|
728 |
const SDL_Rect * rect);
|
slouken@5145
|
729 |
|
slouken@5145
|
730 |
/**
|
slouken@5145
|
731 |
* \brief Draw some number of rectangles on the current rendering target.
|
slouken@7191
|
732 |
*
|
philipp@7188
|
733 |
* \param renderer The renderer which should draw multiple rectangles.
|
slouken@5145
|
734 |
* \param rects A pointer to an array of destination rectangles.
|
slouken@5145
|
735 |
* \param count The number of rectangles.
|
slouken@7191
|
736 |
*
|
slouken@5147
|
737 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
738 |
*/
|
slouken@5147
|
739 |
extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
|
slouken@5297
|
740 |
const SDL_Rect * rects,
|
slouken@5147
|
741 |
int count);
|
slouken@5145
|
742 |
|
slouken@5145
|
743 |
/**
|
slouken@5145
|
744 |
* \brief Fill a rectangle on the current rendering target with the drawing color.
|
slouken@7191
|
745 |
*
|
philipp@7188
|
746 |
* \param renderer The renderer which should fill a rectangle.
|
slouken@7191
|
747 |
* \param rect A pointer to the destination rectangle, or NULL for the entire
|
slouken@5145
|
748 |
* rendering target.
|
slouken@7191
|
749 |
*
|
slouken@5147
|
750 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
751 |
*/
|
slouken@5147
|
752 |
extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
|
slouken@5147
|
753 |
const SDL_Rect * rect);
|
slouken@5145
|
754 |
|
slouken@5145
|
755 |
/**
|
slouken@5145
|
756 |
* \brief Fill some number of rectangles on the current rendering target with the drawing color.
|
slouken@7191
|
757 |
*
|
philipp@7188
|
758 |
* \param renderer The renderer which should fill multiple rectangles.
|
slouken@5145
|
759 |
* \param rects A pointer to an array of destination rectangles.
|
slouken@5145
|
760 |
* \param count The number of rectangles.
|
slouken@7191
|
761 |
*
|
slouken@5147
|
762 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
763 |
*/
|
slouken@5147
|
764 |
extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
|
slouken@5486
|
765 |
const SDL_Rect * rects,
|
slouken@5147
|
766 |
int count);
|
slouken@5145
|
767 |
|
slouken@5145
|
768 |
/**
|
slouken@5145
|
769 |
* \brief Copy a portion of the texture to the current rendering target.
|
slouken@7191
|
770 |
*
|
philipp@7188
|
771 |
* \param renderer The renderer which should copy parts of a texture.
|
slouken@5145
|
772 |
* \param texture The source texture.
|
slouken@7191
|
773 |
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
slouken@5145
|
774 |
* texture.
|
slouken@7191
|
775 |
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
slouken@5145
|
776 |
* entire rendering target.
|
slouken@7191
|
777 |
*
|
slouken@5147
|
778 |
* \return 0 on success, or -1 on error
|
slouken@5145
|
779 |
*/
|
slouken@5147
|
780 |
extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
|
slouken@5147
|
781 |
SDL_Texture * texture,
|
slouken@5145
|
782 |
const SDL_Rect * srcrect,
|
slouken@5145
|
783 |
const SDL_Rect * dstrect);
|
slouken@5145
|
784 |
|
gabomdq@6320
|
785 |
/**
|
slouken@7191
|
786 |
* \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
|
gabomdq@6320
|
787 |
*
|
philipp@7188
|
788 |
* \param renderer The renderer which should copy parts of a texture.
|
gabomdq@6320
|
789 |
* \param texture The source texture.
|
gabomdq@6320
|
790 |
* \param srcrect A pointer to the source rectangle, or NULL for the entire
|
gabomdq@6320
|
791 |
* texture.
|
gabomdq@6320
|
792 |
* \param dstrect A pointer to the destination rectangle, or NULL for the
|
gabomdq@6320
|
793 |
* entire rendering target.
|
gabomdq@6320
|
794 |
* \param angle An angle in degrees that indicates the rotation that will be applied to dstrect
|
philipp@9323
|
795 |
* \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).
|
slouken@6826
|
796 |
* \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
|
slouken@7191
|
797 |
*
|
gabomdq@6320
|
798 |
* \return 0 on success, or -1 on error
|
gabomdq@6320
|
799 |
*/
|
gabomdq@6320
|
800 |
extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer,
|
gabomdq@6320
|
801 |
SDL_Texture * texture,
|
gabomdq@6320
|
802 |
const SDL_Rect * srcrect,
|
gabomdq@6320
|
803 |
const SDL_Rect * dstrect,
|
gabomdq@6320
|
804 |
const double angle,
|
gabomdq@6320
|
805 |
const SDL_Point *center,
|
gabomdq@6320
|
806 |
const SDL_RendererFlip flip);
|
slouken@6232
|
807 |
|
slouken@6232
|
808 |
/**
|
slouken@5145
|
809 |
* \brief Read pixels from the current rendering target.
|
slouken@7191
|
810 |
*
|
philipp@7188
|
811 |
* \param renderer The renderer from which pixels should be read.
|
slouken@7191
|
812 |
* \param rect A pointer to the rectangle to read, or NULL for the entire
|
slouken@5145
|
813 |
* render target.
|
slouken@5145
|
814 |
* \param format The desired format of the pixel data, or 0 to use the format
|
slouken@5145
|
815 |
* of the rendering target
|
slouken@5145
|
816 |
* \param pixels A pointer to be filled in with the pixel data
|
slouken@5145
|
817 |
* \param pitch The pitch of the pixels parameter.
|
slouken@7191
|
818 |
*
|
slouken@5145
|
819 |
* \return 0 on success, or -1 if pixel reading is not supported.
|
slouken@7191
|
820 |
*
|
slouken@5145
|
821 |
* \warning This is a very slow operation, and should not be used frequently.
|
slouken@5145
|
822 |
*/
|
slouken@5147
|
823 |
extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
|
slouken@5147
|
824 |
const SDL_Rect * rect,
|
slouken@5145
|
825 |
Uint32 format,
|
slouken@5145
|
826 |
void *pixels, int pitch);
|
slouken@5145
|
827 |
|
slouken@5145
|
828 |
/**
|
slouken@5145
|
829 |
* \brief Update the screen with rendering performed.
|
slouken@5145
|
830 |
*/
|
slouken@5147
|
831 |
extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
|
slouken@5145
|
832 |
|
slouken@5145
|
833 |
/**
|
slouken@5145
|
834 |
* \brief Destroy the specified texture.
|
slouken@7191
|
835 |
*
|
slouken@5145
|
836 |
* \sa SDL_CreateTexture()
|
slouken@5145
|
837 |
* \sa SDL_CreateTextureFromSurface()
|
slouken@5145
|
838 |
*/
|
slouken@5145
|
839 |
extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
|
slouken@5145
|
840 |
|
slouken@5145
|
841 |
/**
|
slouken@5145
|
842 |
* \brief Destroy the rendering context for a window and free associated
|
slouken@5145
|
843 |
* textures.
|
slouken@7191
|
844 |
*
|
slouken@5145
|
845 |
* \sa SDL_CreateRenderer()
|
slouken@5145
|
846 |
*/
|
slouken@5147
|
847 |
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
|
slouken@5145
|
848 |
|
slouken@5145
|
849 |
|
gabomdq@6414
|
850 |
/**
|
gabomdq@6414
|
851 |
* \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
|
gabomdq@6414
|
852 |
* OpenGL instructions.
|
gabomdq@6414
|
853 |
*
|
gabomdq@6414
|
854 |
* \param texture The SDL texture to bind
|
gabomdq@6414
|
855 |
* \param texw A pointer to a float that will be filled with the texture width
|
gabomdq@6414
|
856 |
* \param texh A pointer to a float that will be filled with the texture height
|
gabomdq@6414
|
857 |
*
|
gabomdq@6414
|
858 |
* \return 0 on success, or -1 if the operation is not supported
|
gabomdq@6414
|
859 |
*/
|
gabomdq@6414
|
860 |
extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
|
gabomdq@6414
|
861 |
|
gabomdq@6414
|
862 |
/**
|
gabomdq@6414
|
863 |
* \brief Unbind a texture from the current OpenGL/ES/ES2 context.
|
gabomdq@6414
|
864 |
*
|
gabomdq@6414
|
865 |
* \param texture The SDL texture to unbind
|
gabomdq@6414
|
866 |
*
|
gabomdq@6414
|
867 |
* \return 0 on success, or -1 if the operation is not supported
|
gabomdq@6414
|
868 |
*/
|
gabomdq@6414
|
869 |
extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture);
|
gabomdq@6414
|
870 |
|
gabomdq@6414
|
871 |
|
slouken@5145
|
872 |
/* Ends C function definitions when using C++ */
|
slouken@5145
|
873 |
#ifdef __cplusplus
|
slouken@5145
|
874 |
}
|
slouken@5145
|
875 |
#endif
|
slouken@5145
|
876 |
#include "close_code.h"
|
slouken@5145
|
877 |
|
slouken@5145
|
878 |
#endif /* _SDL_render_h */
|
slouken@5145
|
879 |
|
slouken@5145
|
880 |
/* vi: set ts=4 sw=4 expandtab: */
|