SDL  2.0
SDL_sysrender.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2017 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "../SDL_internal.h"
22 
23 #ifndef SDL_sysrender_h_
24 #define SDL_sysrender_h_
25 
26 #include "SDL_render.h"
27 #include "SDL_events.h"
28 #include "SDL_yuv_sw_c.h"
29 
30 /* The SDL 2D rendering system */
31 
32 typedef struct SDL_RenderDriver SDL_RenderDriver;
33 
34 typedef struct
35 {
36  float x;
37  float y;
38 } SDL_FPoint;
39 
40 typedef struct
41 {
42  float x;
43  float y;
44  float w;
45  float h;
46 } SDL_FRect;
47 
48 /* Define the SDL texture structure */
50 {
51  const void *magic;
52  Uint32 format; /**< The pixel format of the texture */
53  int access; /**< SDL_TextureAccess */
54  int w; /**< The width of the texture */
55  int h; /**< The height of the texture */
56  int modMode; /**< The texture modulation mode */
57  SDL_BlendMode blendMode; /**< The texture blend mode */
58  Uint8 r, g, b, a; /**< Texture modulation values */
59 
61 
62  /* Support for formats not supported directly by the renderer */
65  void *pixels;
66  int pitch;
68 
69  void *driverdata; /**< Driver specific texture representation */
70 
73 };
74 
75 /* Define the SDL renderer structure */
77 {
78  const void *magic;
79 
81  int (*GetOutputSize) (SDL_Renderer * renderer, int *w, int *h);
91  const SDL_Rect * rect, const void *pixels,
92  int pitch);
94  const SDL_Rect * rect,
95  const Uint8 *Yplane, int Ypitch,
96  const Uint8 *Uplane, int Upitch,
97  const Uint8 *Vplane, int Vpitch);
99  const SDL_Rect * rect, void **pixels, int *pitch);
106  int count);
108  int count);
110  int count);
112  const SDL_Rect * srcrect, const SDL_FRect * dstrect);
114  const SDL_Rect * srcquad, const SDL_FRect * dstrect,
115  const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
117  Uint32 format, void * pixels, int pitch);
120 
122 
123  int (*GL_BindTexture) (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh);
125 
126  /* The current renderer info */
128 
129  /* The window associated with the renderer */
132 
133  /* The logical resolution for rendering */
138 
139  /* Whether or not to force the viewport to even integer intervals */
141 
142  /* The drawable area within the window */
145 
146  /* The clip rectangle within the window */
149 
150  /* Wether or not the clipping rectangle is used. */
153 
154  /* The render output coordinate scale */
157 
158  /* The pixel to point coordinate scale */
160 
161  /* The list of textures */
164 
165  Uint8 r, g, b, a; /**< Color for drawing operations values */
166  SDL_BlendMode blendMode; /**< The drawing blend mode */
167 
168  void *driverdata;
169 };
170 
171 /* Define the SDL render driver structure */
173 {
174  SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
175 
176  /* Info about the renderer capabilities */
178 };
179 
180 /* Not all of these are available in a given build. Use #ifdefs, etc. */
189 
190 /* Blend mode functions */
197 
198 #endif /* SDL_sysrender_h_ */
199 
200 /* vi: set ts=4 sw=4 expandtab: */
SDL_BlendFactor
The normalized factor used to multiply pixel components.
Definition: SDL_blendmode.h:75
void * pixels
Definition: SDL_sysrender.h:65
int(* UpdateClipRect)(SDL_Renderer *renderer)
SDL_BlendMode blendMode
Definition: SDL_sysrender.h:57
SDL_BlendFactor SDL_GetBlendModeSrcColorFactor(SDL_BlendMode blendMode)
Definition: SDL_render.c:2143
void(* WindowEvent)(SDL_Renderer *renderer, const SDL_WindowEvent *event)
Definition: SDL_sysrender.h:80
SDL_RendererInfo info
SDL_Rect clip_rect_backup
int(* RenderClear)(SDL_Renderer *renderer)
SDL_RenderDriver GLES_RenderDriver
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:40
int(* RenderDrawPoints)(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
SDL_RenderDriver DirectFB_RenderDriver
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
SDL_Rect rect
Definition: testrelative.c:27
SDL_BlendFactor SDL_GetBlendModeSrcAlphaFactor(SDL_BlendMode blendMode)
Definition: SDL_render.c:2164
int(* SetRenderTarget)(SDL_Renderer *renderer, SDL_Texture *texture)
int(* CreateTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:83
SDL_RenderDriver D3D11_RenderDriver
SDL_bool hidden
GLfloat GLfloat GLfloat GLfloat h
void * driverdata
SDL_RenderDriver PSP_RenderDriver
SDL_FPoint scale
SDL_Rect locked_rect
Definition: SDL_sysrender.h:67
void(* UnlockTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
SDL_RenderDriver GL_RenderDriver
SDL_Rect clip_rect
uint32_t Uint32
Definition: SDL_stdinc.h:181
SDL_Texture * textures
SDL_BlendOperation
The blend operation used when combining source and destination pixel components.
Definition: SDL_blendmode.h:62
SDL_Window * window
SDL_RendererInfo info
GLfixed GLfixed GLint GLint GLfixed points
SDL_FPoint scale_backup
static SDL_BlendMode blendMode
Definition: testdraw2.c:34
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
int(* LockTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
Definition: SDL_sysrender.h:98
SDL_RenderDriver GLES2_RenderDriver
SDL_Texture * next
Definition: SDL_sysrender.h:72
GLenum GLenum GLuint texture
int(* UpdateTextureYUV)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
Definition: SDL_sysrender.h:93
int(* UpdateTexture)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
Definition: SDL_sysrender.h:90
SDL_Texture * prev
Definition: SDL_sysrender.h:71
SDL_RenderDriver SW_RenderDriver
Definition: SDL_render_sw.c:78
SDL_Texture * target
static SDL_Renderer * renderer
uint8_t Uint8
Definition: SDL_stdinc.h:157
struct _cl_event * event
SDL_SW_YUVTexture * yuv
Definition: SDL_sysrender.h:64
SDL_BlendMode blendMode
int(* RenderDrawLines)(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
GLubyte GLubyte GLubyte GLubyte w
int(* SetTextureColorMod)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:84
SDL_RenderDriver D3D_RenderDriver
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: SDL_opengl.h:1572
void(* DestroyTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
int(* RenderCopy)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
SDL_RendererFlip
Flip constants for SDL_RenderCopyEx.
Definition: SDL_render.h:111
Window state change event data (event.window.*)
Definition: SDL_events.h:174
int(* SetTextureBlendMode)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:88
SDL_bool
Definition: SDL_stdinc.h:139
SDL_BlendFactor SDL_GetBlendModeDstAlphaFactor(SDL_BlendMode blendMode)
Definition: SDL_render.c:2171
int(* GetOutputSize)(SDL_Renderer *renderer, int *w, int *h)
Definition: SDL_sysrender.h:81
SDL_BlendOperation SDL_GetBlendModeAlphaOperation(SDL_BlendMode blendMode)
Definition: SDL_render.c:2178
int(* GL_BindTexture)(SDL_Renderer *renderer, SDL_Texture *texture, float *texw, float *texh)
Information on the capabilities of a render driver or context.
Definition: SDL_render.h:78
GLbitfield flags
SDL_Renderer * renderer
Definition: SDL_sysrender.h:60
int(* RenderReadPixels)(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
int(* GL_UnbindTexture)(SDL_Renderer *renderer, SDL_Texture *texture)
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDL_Rect viewport
int(* RenderFillRects)(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_bool(* SupportsBlendMode)(SDL_Renderer *renderer, SDL_BlendMode blendMode)
Definition: SDL_sysrender.h:82
SDL_BlendFactor SDL_GetBlendModeDstColorFactor(SDL_BlendMode blendMode)
Definition: SDL_render.c:2150
GLfloat angle
const void * magic
Definition: SDL_sysrender.h:78
Uint32 format
Definition: SDL_sysrender.h:52
void * driverdata
Definition: SDL_sysrender.h:69
int(* UpdateViewport)(SDL_Renderer *renderer)
SDL_Texture * native
Definition: SDL_sysrender.h:63
EGLSurface EGLint * rects
Definition: eglext.h:282
int(* RenderCopyEx)(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcquad, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
SDL_Rect viewport_backup
void(* RenderPresent)(SDL_Renderer *renderer)
void(* DestroyRenderer)(SDL_Renderer *renderer)
const void * magic
Definition: SDL_sysrender.h:51
int(* SetTextureAlphaMod)(SDL_Renderer *renderer, SDL_Texture *texture)
Definition: SDL_sysrender.h:86
SDL_bool clipping_enabled_backup
SDL_FPoint dpi_scale
SDL_BlendOperation SDL_GetBlendModeColorOperation(SDL_BlendMode blendMode)
Definition: SDL_render.c:2157
SDL_bool integer_scale
SDL_bool clipping_enabled
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:64