include/SDL_render.h
author Sam Lantinga <slouken@libsdl.org>
Wed, 29 May 2013 03:22:19 -0700
changeset 7240 39eb4958950a
parent 7239 04dda95ba22c
child 7542 399ff49069a5
permissions -rw-r--r--
When the window is resized, the viewport is automatically reset.
This resolves lots of confusion around resizable windows. Most people don't expect a viewport to be implicitly set when the renderer is created and then not to be reset to the window size if the window is resized.

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