include/SDL_render.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 22 Jan 2012 01:29:26 -0500
changeset 6248 7fe4b2b78acc
parent 6247 b6212690f78d
child 6258 fce7ce72677b
permissions -rw-r--r--
You need to create the texture with the SDL_TEXTUREACCESS_TARGET flag.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
/*
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
     2
  Simple DirectMedia Layer
6138
4c64952a58fb Happy New Year!
Sam Lantinga <slouken@libsdl.org>
parents: 6039
diff changeset
     3
  Copyright (C) 1997-2012 Sam Lantinga <slouken@libsdl.org>
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
     5
  This software is provided 'as-is', without any express or implied
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
     6
  warranty.  In no event will the authors be held liable for any damages
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
     7
  arising from the use of this software.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
     9
  Permission is granted to anyone to use this software for any purpose,
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    10
  including commercial applications, and to alter it and redistribute it
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    11
  freely, subject to the following restrictions:
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
5535
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    13
  1. The origin of this software must not be misrepresented; you must not
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    14
     claim that you wrote the original software. If you use this software
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    15
     in a product, an acknowledgment in the product documentation would be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    16
     appreciated but is not required.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    17
  2. Altered source versions must be plainly marked as such, and must not be
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    18
     misrepresented as being the original software.
96594ac5fd1a SDL 1.3 is now under the zlib license.
Sam Lantinga <slouken@libsdl.org>
parents: 5528
diff changeset
    19
  3. This notice may not be removed or altered from any source distribution.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
*/
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
 *  \file SDL_render.h
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
 *  Header file for SDL 2D rendering functions.
5164
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    26
 *
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    27
 *  This API supports the following features:
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    28
 *      * single pixel points
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    29
 *      * single pixel lines
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    30
 *      * filled rectangles
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    31
 *      * texture images
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    32
 *
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    33
 *  The primitives may be drawn in opaque, blended, or additive modes.
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    34
 *
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    35
 *  The texture images may be drawn in opaque, blended, or additive modes.
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    36
 *  They can have an additional color tint or alpha modulation applied to
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    37
 *  them, and may also be stretched with linear interpolation.
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    38
 *
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    39
 *  This API is designed to accelerate simple 2D operations. You may
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    40
 *  want more functionality such as rotation and particle effects and
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    41
 *  in that case you should use SDL's OpenGL/Direct3D support or one
97423d858a1a Added an intro to the features and goals of the 2D rendering API.
Sam Lantinga <slouken@libsdl.org>
parents: 5158
diff changeset
    42
 *  of the many good 3D engines.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    43
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    44
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    45
#ifndef _SDL_render_h
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    46
#define _SDL_render_h
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    47
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    48
#include "SDL_stdinc.h"
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    49
#include "SDL_rect.h"
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    50
#include "SDL_video.h"
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    51
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    52
#include "begin_code.h"
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    53
/* Set up for C function definitions, even when using C++ */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    54
#ifdef __cplusplus
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    55
/* *INDENT-OFF* */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    56
extern "C" {
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    57
/* *INDENT-ON* */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    58
#endif
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    59
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    60
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    61
 *  \brief Flags used when creating a rendering context
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    62
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    63
typedef enum
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    64
{
5337
d5d312a82d40 Allow the application to explicitly request a software renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5297
diff changeset
    65
    SDL_RENDERER_SOFTWARE = 0x00000001,         /**< The renderer is a software fallback */ 
d5d312a82d40 Allow the application to explicitly request a software renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5297
diff changeset
    66
    SDL_RENDERER_ACCELERATED = 0x00000002,      /**< The renderer uses hardware 
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    67
                                                     acceleration */
6237
240f1bced46b Added a renderer flag to expose whether a renderer supports render to texture.
Sam Lantinga <slouken@libsdl.org>
parents: 6232
diff changeset
    68
    SDL_RENDERER_PRESENTVSYNC = 0x00000004,     /**< Present is synchronized 
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    69
                                                     with the refresh rate */
6237
240f1bced46b Added a renderer flag to expose whether a renderer supports render to texture.
Sam Lantinga <slouken@libsdl.org>
parents: 6232
diff changeset
    70
    SDL_RENDERER_TARGETTEXTURE = 0x00000008     /**< The renderer supports
240f1bced46b Added a renderer flag to expose whether a renderer supports render to texture.
Sam Lantinga <slouken@libsdl.org>
parents: 6232
diff changeset
    71
                                                     rendering to texture */
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    72
} SDL_RendererFlags;
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    73
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    74
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    75
 *  \brief Information on the capabilities of a render driver or context.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    76
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    77
typedef struct SDL_RendererInfo
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    78
{
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    79
    const char *name;           /**< The name of the renderer */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    80
    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    81
    Uint32 num_texture_formats; /**< The number of available texture formats */
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
    82
    Uint32 texture_formats[16]; /**< The available texture formats */
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    83
    int max_texture_width;      /**< The maximimum texture width */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    84
    int max_texture_height;     /**< The maximimum texture height */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    85
} SDL_RendererInfo;
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    86
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    87
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    88
 *  \brief The access pattern allowed for a texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    89
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    90
typedef enum
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    91
{
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    92
    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
6232
37e8d0736366 Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    93
    SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
37e8d0736366 Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
    94
    SDL_TEXTUREACCESS_TARGET     /**< Texture can be used as a render target */
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    95
} SDL_TextureAccess;
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    96
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    97
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    98
 *  \brief The texture channel modulation used in SDL_RenderCopy().
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    99
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   100
typedef enum
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   101
{
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   102
    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   103
    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   104
    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   105
} SDL_TextureModulate;
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   106
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   107
/**
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   108
 *  \brief A structure representing rendering state
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   109
 */
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   110
struct SDL_Renderer;
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   111
typedef struct SDL_Renderer SDL_Renderer;
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   112
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   113
/**
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   114
 *  \brief An efficient driver-specific representation of pixel data
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   115
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   116
struct SDL_Texture;
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   117
typedef struct SDL_Texture SDL_Texture;
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   118
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   119
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   120
/* Function prototypes */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   121
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   122
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   123
 *  \brief Get the number of 2D rendering drivers available for the current 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   124
 *         display.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   125
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   126
 *  A render driver is a set of code that handles rendering and texture
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   127
 *  management on a particular display.  Normally there is only one, but
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   128
 *  some drivers may have several available with different capabilities.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   129
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   130
 *  \sa SDL_GetRenderDriverInfo()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   131
 *  \sa SDL_CreateRenderer()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   132
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   133
extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   134
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   135
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   136
 *  \brief Get information about a specific 2D rendering driver for the current 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   137
 *         display.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   138
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   139
 *  \param index The index of the driver to query information about.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   140
 *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   141
 *               information on the rendering driver.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   142
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   143
 *  \return 0 on success, -1 if the index was out of range.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   144
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   145
 *  \sa SDL_CreateRenderer()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   146
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   147
extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   148
                                                    SDL_RendererInfo * info);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   149
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   150
/**
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   151
 *  \brief Create a 2D rendering context for a window.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   152
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   153
 *  \param window The window where rendering is displayed.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   154
 *  \param index    The index of the rendering driver to initialize, or -1 to 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   155
 *                  initialize the first one supporting the requested flags.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   156
 *  \param flags    ::SDL_RendererFlags.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   157
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   158
 *  \return A valid rendering context or NULL if there was an error.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   159
 *  
5166
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   160
 *  \sa SDL_CreateSoftwareRenderer()
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   161
 *  \sa SDL_GetRendererInfo()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   162
 *  \sa SDL_DestroyRenderer()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   163
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   164
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   165
                                               int index, Uint32 flags);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   166
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   167
/**
5166
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   168
 *  \brief Create a 2D software rendering context for a surface.
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   169
 *  
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   170
 *  \param surface The surface where rendering is done.
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   171
 *  
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   172
 *  \return A valid rendering context or NULL if there was an error.
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   173
 *  
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   174
 *  \sa SDL_CreateRenderer()
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   175
 *  \sa SDL_DestroyRenderer()
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   176
 */
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   177
extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   178
4d39eeaad00b Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5164
diff changeset
   179
/**
5528
15c9c03a80cc Added SDL_GetRenderer()
Sam Lantinga <slouken@libsdl.org>
parents: 5486
diff changeset
   180
 *  \brief Get the renderer associated with a window.
15c9c03a80cc Added SDL_GetRenderer()
Sam Lantinga <slouken@libsdl.org>
parents: 5486
diff changeset
   181
 */
15c9c03a80cc Added SDL_GetRenderer()
Sam Lantinga <slouken@libsdl.org>
parents: 5486
diff changeset
   182
extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
15c9c03a80cc Added SDL_GetRenderer()
Sam Lantinga <slouken@libsdl.org>
parents: 5486
diff changeset
   183
15c9c03a80cc Added SDL_GetRenderer()
Sam Lantinga <slouken@libsdl.org>
parents: 5486
diff changeset
   184
/**
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   185
 *  \brief Get information about a rendering context.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   186
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   187
extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   188
                                                SDL_RendererInfo * info);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   189
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   190
/**
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   191
 *  \brief Create a texture for a rendering context.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   192
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   193
 *  \param format The format of the texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   194
 *  \param access One of the enumerated values in ::SDL_TextureAccess.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   195
 *  \param w      The width of the texture in pixels.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   196
 *  \param h      The height of the texture in pixels.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   197
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   198
 *  \return The created texture is returned, or 0 if no rendering context was 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   199
 *          active,  the format was unsupported, or the width or height were out
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   200
 *          of range.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   201
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   202
 *  \sa SDL_QueryTexture()
5216
16d5e8e90e01 Updated testoverlay2 to use the SDL 2D rendering API
Sam Lantinga <slouken@libsdl.org>
parents: 5166
diff changeset
   203
 *  \sa SDL_UpdateTexture()
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   204
 *  \sa SDL_DestroyTexture()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   205
 */
5344
94189aa89b54 Whoops, the format parameter was off the page.
Sam Lantinga <slouken@libsdl.org>
parents: 5337
diff changeset
   206
extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,
94189aa89b54 Whoops, the format parameter was off the page.
Sam Lantinga <slouken@libsdl.org>
parents: 5337
diff changeset
   207
                                                        Uint32 format,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   208
                                                        int access, int w,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   209
                                                        int h);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   210
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   211
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   212
 *  \brief Create a texture from an existing surface.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   213
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   214
 *  \param surface The surface containing pixel data used to fill the texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   215
 *  
5158
b3ccd1947786 Simplified and improved the process of creating a texture from a surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5157
diff changeset
   216
 *  \return The created texture is returned, or 0 on error.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   217
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   218
 *  \note The surface is not modified or freed by this function.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   219
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   220
 *  \sa SDL_QueryTexture()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   221
 *  \sa SDL_DestroyTexture()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   222
 */
5158
b3ccd1947786 Simplified and improved the process of creating a texture from a surface.
Sam Lantinga <slouken@libsdl.org>
parents: 5157
diff changeset
   223
extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   224
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   225
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   226
 *  \brief Query the attributes of a texture
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   227
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   228
 *  \param texture A texture to be queried.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   229
 *  \param format  A pointer filled in with the raw format of the texture.  The 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   230
 *                 actual format may differ, but pixel transfers will use this 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   231
 *                 format.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   232
 *  \param access  A pointer filled in with the actual access to the texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   233
 *  \param w       A pointer filled in with the width of the texture in pixels.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   234
 *  \param h       A pointer filled in with the height of the texture in pixels.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   235
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   236
 *  \return 0 on success, or -1 if the texture is not valid.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   237
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   238
extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   239
                                             Uint32 * format, int *access,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   240
                                             int *w, int *h);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   241
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   242
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   243
 *  \brief Set an additional color value used in render copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   244
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   245
 *  \param texture The texture to update.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   246
 *  \param r       The red color value multiplied into copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   247
 *  \param g       The green color value multiplied into copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   248
 *  \param b       The blue color value multiplied into copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   249
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   250
 *  \return 0 on success, or -1 if the texture is not valid or color modulation 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   251
 *          is not supported.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   252
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   253
 *  \sa SDL_GetTextureColorMod()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   254
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   255
extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   256
                                                   Uint8 r, Uint8 g, Uint8 b);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   257
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   258
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   259
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   260
 *  \brief Get the additional color value used in render copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   261
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   262
 *  \param texture The texture to query.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   263
 *  \param r         A pointer filled in with the current red color value.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   264
 *  \param g         A pointer filled in with the current green color value.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   265
 *  \param b         A pointer filled in with the current blue color value.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   266
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   267
 *  \return 0 on success, or -1 if the texture is not valid.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   268
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   269
 *  \sa SDL_SetTextureColorMod()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   270
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   271
extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   272
                                                   Uint8 * r, Uint8 * g,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   273
                                                   Uint8 * b);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   274
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   275
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   276
 *  \brief Set an additional alpha value used in render copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   277
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   278
 *  \param texture The texture to update.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   279
 *  \param alpha     The alpha value multiplied into copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   280
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   281
 *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   282
 *          is not supported.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   283
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   284
 *  \sa SDL_GetTextureAlphaMod()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   285
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   286
extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   287
                                                   Uint8 alpha);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   288
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   289
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   290
 *  \brief Get the additional alpha value used in render copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   291
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   292
 *  \param texture The texture to query.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   293
 *  \param alpha     A pointer filled in with the current alpha value.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   294
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   295
 *  \return 0 on success, or -1 if the texture is not valid.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   296
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   297
 *  \sa SDL_SetTextureAlphaMod()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   298
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   299
extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   300
                                                   Uint8 * alpha);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   301
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   302
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   303
 *  \brief Set the blend mode used for texture copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   304
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   305
 *  \param texture The texture to update.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   306
 *  \param blendMode ::SDL_BlendMode to use for texture blending.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   307
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   308
 *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   309
 *          not supported.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   310
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   311
 *  \note If the blend mode is not supported, the closest supported mode is
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   312
 *        chosen.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   313
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   314
 *  \sa SDL_GetTextureBlendMode()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   315
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   316
extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   317
                                                    SDL_BlendMode blendMode);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   318
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   319
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   320
 *  \brief Get the blend mode used for texture copy operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   321
 *  
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
   322
 *  \param texture   The texture to query.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   323
 *  \param blendMode A pointer filled in with the current blend mode.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   324
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   325
 *  \return 0 on success, or -1 if the texture is not valid.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   326
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   327
 *  \sa SDL_SetTextureBlendMode()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   328
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   329
extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   330
                                                    SDL_BlendMode *blendMode);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   331
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   332
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   333
 *  \brief Update the given texture rectangle with new pixel data.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   334
 *  
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
   335
 *  \param texture   The texture to update
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   336
 *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   337
 *                   update the entire texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   338
 *  \param pixels    The raw pixel data.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   339
 *  \param pitch     The number of bytes between rows of pixel data.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   340
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   341
 *  \return 0 on success, or -1 if the texture is not valid.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   342
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   343
 *  \note This is a fairly slow function.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   344
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   345
extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   346
                                              const SDL_Rect * rect,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   347
                                              const void *pixels, int pitch);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   348
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   349
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   350
 *  \brief Lock a portion of the texture for pixel access.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   351
 *  
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
   352
 *  \param texture   The texture to lock for access, which was created with 
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   353
 *                   ::SDL_TEXTUREACCESS_STREAMING.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   354
 *  \param rect      A pointer to the rectangle to lock for access. If the rect 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   355
 *                   is NULL, the entire texture will be locked.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   356
 *  \param pixels    This is filled in with a pointer to the locked pixels, 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   357
 *                   appropriately offset by the locked area.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   358
 *  \param pitch     This is filled in with the pitch of the locked pixels.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   359
 *  
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
   360
 *  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   361
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   362
 *  \sa SDL_UnlockTexture()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   363
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   364
extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   365
                                            const SDL_Rect * rect,
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
   366
                                            void **pixels, int *pitch);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   367
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   368
/**
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
   369
 *  \brief Unlock a texture, uploading the changes to video memory, if needed.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   370
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   371
 *  \sa SDL_LockTexture()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   372
 */
5156
307ccc9c135e Made it possible to create a texture of any format, even if not supported by the renderer.
Sam Lantinga <slouken@libsdl.org>
parents: 5149
diff changeset
   373
extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   374
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   375
/**
6247
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   376
 * \brief Determines whether a window supports the use of render targets
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   377
 *
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   378
 * \param renderer The renderer that will be checked
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   379
 *
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   380
 * \return SDL_TRUE if supported, SDL_FALSE if not.
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   381
 */
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   382
extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   383
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   384
/**
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   385
 * \brief Set a texture as the current rendering target.
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   386
 *
6248
7fe4b2b78acc You need to create the texture with the SDL_TEXTUREACCESS_TARGET flag.
Sam Lantinga <slouken@libsdl.org>
parents: 6247
diff changeset
   387
 * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
6247
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   388
 *
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   389
 * \return 0 on success, or -1 on error
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   390
 */
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   391
extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   392
                                                SDL_Texture *texture);
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   393
b6212690f78d Renamed SetTargetTexture() to SetRenderTarget()
Sam Lantinga <slouken@libsdl.org>
parents: 6237
diff changeset
   394
/**
5297
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   395
 *  \brief Set the drawing area for rendering on the current target.
5224
2178ffe17222 Added function SDL_RenderSetClipRect()
Sam Lantinga <slouken@libsdl.org>
parents: 5216
diff changeset
   396
 *
5297
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   397
 *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   398
 *
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   399
 *  The x,y of the viewport rect represents the origin for rendering.
5224
2178ffe17222 Added function SDL_RenderSetClipRect()
Sam Lantinga <slouken@libsdl.org>
parents: 5216
diff changeset
   400
 *
5297
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   401
 *  \note When the window is resized, the current viewport is automatically
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   402
 *        centered within the new window size.
5224
2178ffe17222 Added function SDL_RenderSetClipRect()
Sam Lantinga <slouken@libsdl.org>
parents: 5216
diff changeset
   403
 */
5297
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   404
extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   405
                                                  const SDL_Rect * rect);
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   406
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   407
/**
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   408
 *  \brief Get the drawing area for the current target.
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   409
 */
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   410
extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   411
                                                   SDL_Rect * rect);
5224
2178ffe17222 Added function SDL_RenderSetClipRect()
Sam Lantinga <slouken@libsdl.org>
parents: 5216
diff changeset
   412
2178ffe17222 Added function SDL_RenderSetClipRect()
Sam Lantinga <slouken@libsdl.org>
parents: 5216
diff changeset
   413
/**
6039
85afb0c1dd04 The draw color affects RenderClear() as well. (thanks to the feedback form to whoever pointed this out)
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   414
 *  \brief Set the color used for drawing operations (Rect, Line and Clear).
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   415
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   416
 *  \param r The red value used to draw on the rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   417
 *  \param g The green value used to draw on the rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   418
 *  \param b The blue value used to draw on the rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   419
 *  \param a The alpha value used to draw on the rendering target, usually 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   420
 *           ::SDL_ALPHA_OPAQUE (255).
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   421
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   422
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   423
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   424
extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   425
                                           Uint8 r, Uint8 g, Uint8 b,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   426
                                           Uint8 a);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   427
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   428
/**
6039
85afb0c1dd04 The draw color affects RenderClear() as well. (thanks to the feedback form to whoever pointed this out)
Sam Lantinga <slouken@libsdl.org>
parents: 5535
diff changeset
   429
 *  \brief Get the color used for drawing operations (Rect, Line and Clear).
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   430
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   431
 *  \param r A pointer to the red value used to draw on the rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   432
 *  \param g A pointer to the green value used to draw on the rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   433
 *  \param b A pointer to the blue value used to draw on the rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   434
 *  \param a A pointer to the alpha value used to draw on the rendering target, 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   435
 *           usually ::SDL_ALPHA_OPAQUE (255).
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   436
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   437
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   438
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   439
extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   440
                                           Uint8 * r, Uint8 * g, Uint8 * b,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   441
                                           Uint8 * a);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   442
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   443
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   444
 *  \brief Set the blend mode used for drawing operations (Fill and Line).
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   445
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   446
 *  \param blendMode ::SDL_BlendMode to use for blending.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   447
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   448
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   449
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   450
 *  \note If the blend mode is not supported, the closest supported mode is 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   451
 *        chosen.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   452
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   453
 *  \sa SDL_GetRenderDrawBlendMode()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   454
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   455
extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   456
                                                       SDL_BlendMode blendMode);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   457
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   458
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   459
 *  \brief Get the blend mode used for drawing operations.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   460
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   461
 *  \param blendMode A pointer filled in with the current blend mode.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   462
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   463
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   464
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   465
 *  \sa SDL_SetRenderDrawBlendMode()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   466
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   467
extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   468
                                                       SDL_BlendMode *blendMode);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   469
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   470
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   471
 *  \brief Clear the current rendering target with the drawing color
5297
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   472
 *
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   473
 *  This function clears the entire rendering target, ignoring the viewport.
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   474
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   475
extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   476
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   477
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   478
 *  \brief Draw a point on the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   479
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   480
 *  \param x The x coordinate of the point.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   481
 *  \param y The y coordinate of the point.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   482
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   483
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   484
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   485
extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   486
                                                int x, int y);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   487
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   488
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   489
 *  \brief Draw multiple points on the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   490
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   491
 *  \param points The points to draw
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   492
 *  \param count The number of points to draw
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   493
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   494
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   495
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   496
extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   497
                                                 const SDL_Point * points,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   498
                                                 int count);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   499
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   500
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   501
 *  \brief Draw a line on the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   502
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   503
 *  \param x1 The x coordinate of the start point.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   504
 *  \param y1 The y coordinate of the start point.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   505
 *  \param x2 The x coordinate of the end point.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   506
 *  \param y2 The y coordinate of the end point.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   507
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   508
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   509
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   510
extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   511
                                               int x1, int y1, int x2, int y2);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   512
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   513
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   514
 *  \brief Draw a series of connected lines on the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   515
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   516
 *  \param points The points along the lines
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   517
 *  \param count The number of points, drawing count-1 lines
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   518
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   519
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   520
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   521
extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   522
                                                const SDL_Point * points,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   523
                                                int count);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   524
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   525
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   526
 *  \brief Draw a rectangle on the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   527
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   528
 *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   529
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   530
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   531
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   532
extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   533
                                               const SDL_Rect * rect);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   534
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   535
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   536
 *  \brief Draw some number of rectangles on the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   537
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   538
 *  \param rects A pointer to an array of destination rectangles.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   539
 *  \param count The number of rectangles.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   540
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   541
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   542
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   543
extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
5297
1800dc39b74c Changed the concept of a render clip rect to a render viewport.
Sam Lantinga <slouken@libsdl.org>
parents: 5262
diff changeset
   544
                                                const SDL_Rect * rects,
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   545
                                                int count);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   546
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   547
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   548
 *  \brief Fill a rectangle on the current rendering target with the drawing color.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   549
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   550
 *  \param rect A pointer to the destination rectangle, or NULL for the entire 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   551
 *              rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   552
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   553
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   554
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   555
extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   556
                                               const SDL_Rect * rect);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   557
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   558
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   559
 *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   560
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   561
 *  \param rects A pointer to an array of destination rectangles.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   562
 *  \param count The number of rectangles.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   563
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   564
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   565
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   566
extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
5486
a036736283ef Fixed typo
Sam Lantinga <slouken@libsdl.org>
parents: 5344
diff changeset
   567
                                                const SDL_Rect * rects,
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   568
                                                int count);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   569
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   570
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   571
 *  \brief Copy a portion of the texture to the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   572
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   573
 *  \param texture The source texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   574
 *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   575
 *                   texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   576
 *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   577
 *                   entire rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   578
 *  
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   579
 *  \return 0 on success, or -1 on error
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   580
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   581
extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   582
                                           SDL_Texture * texture,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   583
                                           const SDL_Rect * srcrect,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   584
                                           const SDL_Rect * dstrect);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   585
6232
37e8d0736366 Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   586
37e8d0736366 Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Sam Lantinga <slouken@libsdl.org>
parents: 6138
diff changeset
   587
/**
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   588
 *  \brief Read pixels from the current rendering target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   589
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   590
 *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   591
 *                render target.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   592
 *  \param format The desired format of the pixel data, or 0 to use the format
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   593
 *                of the rendering target
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   594
 *  \param pixels A pointer to be filled in with the pixel data
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   595
 *  \param pitch  The pitch of the pixels parameter.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   596
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   597
 *  \return 0 on success, or -1 if pixel reading is not supported.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   598
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   599
 *  \warning This is a very slow operation, and should not be used frequently.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   600
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   601
extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   602
                                                 const SDL_Rect * rect,
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   603
                                                 Uint32 format,
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   604
                                                 void *pixels, int pitch);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   605
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   606
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   607
 *  \brief Update the screen with rendering performed.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   608
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   609
extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   610
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   611
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   612
 *  \brief Destroy the specified texture.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   613
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   614
 *  \sa SDL_CreateTexture()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   615
 *  \sa SDL_CreateTextureFromSurface()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   616
 */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   617
extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   618
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   619
/**
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   620
 *  \brief Destroy the rendering context for a window and free associated
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   621
 *         textures.
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   622
 *  
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   623
 *  \sa SDL_CreateRenderer()
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   624
 */
5147
ad50b3db78bd The rendering functions take a context so it's clear what window they're drawing to. This also potentially opens to the door to multi-threaded rendering in the future.
Sam Lantinga <slouken@libsdl.org>
parents: 5145
diff changeset
   625
extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
5145
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   626
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   627
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   628
/* Ends C function definitions when using C++ */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   629
#ifdef __cplusplus
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   630
/* *INDENT-OFF* */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   631
}
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   632
/* *INDENT-ON* */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   633
#endif
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   634
#include "close_code.h"
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   635
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   636
#endif /* _SDL_render_h */
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   637
2f44e6969a59 Split the rendering API out into a separate header file.
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
   638
/* vi: set ts=4 sw=4 expandtab: */