SDL  2.0
SDL_sysrender.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2018 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_mutex.h"
29 #include "SDL_yuv_sw_c.h"
30 
31 /* The SDL 2D rendering system */
32 
33 typedef struct SDL_RenderDriver SDL_RenderDriver;
34 
35 typedef enum
36 {
41 
42 typedef struct
43 {
44  float x;
45  float y;
46 } SDL_FPoint;
47 
48 typedef struct
49 {
50  float x;
51  float y;
52  float w;
53  float h;
54 } SDL_FRect;
55 
56 /* Define the SDL texture structure */
58 {
59  const void *magic;
60  Uint32 format; /**< The pixel format of the texture */
61  int access; /**< SDL_TextureAccess */
62  int w; /**< The width of the texture */
63  int h; /**< The height of the texture */
64  int modMode; /**< The texture modulation mode */
65  SDL_BlendMode blendMode; /**< The texture blend mode */
66  SDL_ScaleMode scaleMode; /**< The texture scale mode */
67  Uint8 r, g, b, a; /**< Texture modulation values */
68 
70 
71  /* Support for formats not supported directly by the renderer */
74  void *pixels;
75  int pitch;
77 
78  void *driverdata; /**< Driver specific texture representation */
79 
82 };
83 
84 /* Define the SDL renderer structure */
86 {
87  const void *magic;
88 
90  int (*GetOutputSize) (SDL_Renderer * renderer, int *w, int *h);
100  const SDL_Rect * rect, const void *pixels,
101  int pitch);
103  const SDL_Rect * rect,
104  const Uint8 *Yplane, int Ypitch,
105  const Uint8 *Uplane, int Upitch,
106  const Uint8 *Vplane, int Vpitch);
108  const SDL_Rect * rect, void **pixels, int *pitch);
115  int count);
117  int count);
119  int count);
121  const SDL_Rect * srcrect, const SDL_FRect * dstrect);
123  const SDL_Rect * srcquad, const SDL_FRect * dstrect,
124  const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip);
126  Uint32 format, void * pixels, int pitch);
129 
131 
132  int (*GL_BindTexture) (SDL_Renderer * renderer, SDL_Texture *texture, float *texw, float *texh);
134 
135  void *(*GetMetalLayer) (SDL_Renderer * renderer);
136  void *(*GetMetalCommandEncoder) (SDL_Renderer * renderer);
137 
138  /* The current renderer info */
140 
141  /* The window associated with the renderer */
144 
145  /* The logical resolution for rendering */
150 
151  /* Whether or not to force the viewport to even integer intervals */
153 
154  /* The drawable area within the window */
157 
158  /* The clip rectangle within the window */
161 
162  /* Wether or not the clipping rectangle is used. */
165 
166  /* The render output coordinate scale */
169 
170  /* The pixel to point coordinate scale */
172 
173  /* The list of textures */
177 
178  Uint8 r, g, b, a; /**< Color for drawing operations values */
179  SDL_BlendMode blendMode; /**< The drawing blend mode */
180 
181  void *driverdata;
182 };
183 
184 /* Define the SDL render driver structure */
186 {
187  SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
188 
189  /* Info about the renderer capabilities */
191 };
192 
193 /* Not all of these are available in a given build. Use #ifdefs, etc. */
203 
204 /* Blend mode functions */
211 
212 #endif /* SDL_sysrender_h_ */
213 
214 /* vi: set ts=4 sw=4 expandtab: */