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