Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
150 lines (122 loc) · 5.16 KB

SDL_sysrender.h

File metadata and controls

150 lines (122 loc) · 5.16 KB
 
Apr 8, 2011
Apr 8, 2011
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Simple DirectMedia Layer
Copyright (C) 1997-2011 Sam Lantinga <slouken@libsdl.org>
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
20
21
22
23
24
25
26
27
*/
#include "SDL_config.h"
#ifndef _SDL_sysrender_h
#define _SDL_sysrender_h
#include "SDL_render.h"
#include "SDL_events.h"
Feb 3, 2011
Feb 3, 2011
28
#include "SDL_yuv_sw_c.h"
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/* The SDL 2D rendering system */
typedef struct SDL_RenderDriver SDL_RenderDriver;
/* Define the SDL texture structure */
struct SDL_Texture
{
const void *magic;
Uint32 format; /**< The pixel format of the texture */
int access; /**< SDL_TextureAccess */
int w; /**< The width of the texture */
int h; /**< The height of the texture */
int modMode; /**< The texture modulation mode */
SDL_BlendMode blendMode; /**< The texture blend mode */
Uint8 r, g, b, a; /**< Texture modulation values */
SDL_Renderer *renderer;
Feb 3, 2011
Feb 3, 2011
48
49
50
51
52
53
54
/* Support for formats not supported directly by the renderer */
SDL_Texture *native;
SDL_SW_YUVTexture *yuv;
void *pixels;
int pitch;
SDL_Rect locked_rect;
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
void *driverdata; /**< Driver specific texture representation */
SDL_Texture *prev;
SDL_Texture *next;
};
/* Define the SDL renderer structure */
struct SDL_Renderer
{
const void *magic;
void (*WindowEvent) (SDL_Renderer * renderer, const SDL_WindowEvent *event);
int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
int (*SetTextureColorMod) (SDL_Renderer * renderer,
SDL_Texture * texture);
int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
SDL_Texture * texture);
int (*SetTextureBlendMode) (SDL_Renderer * renderer,
SDL_Texture * texture);
int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * rect, const void *pixels,
int pitch);
int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
Feb 3, 2011
Feb 3, 2011
78
const SDL_Rect * rect, void **pixels, int *pitch);
79
void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
Feb 15, 2011
Feb 15, 2011
80
int (*UpdateViewport) (SDL_Renderer * renderer);
81
82
83
84
85
int (*RenderClear) (SDL_Renderer * renderer);
int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
int count);
int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points,
int count);
Feb 15, 2011
Feb 15, 2011
86
int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect * rects,
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
int count);
int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
const SDL_Rect * srcrect, const SDL_Rect * dstrect);
int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
Uint32 format, void * pixels, int pitch);
void (*RenderPresent) (SDL_Renderer * renderer);
void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
void (*DestroyRenderer) (SDL_Renderer * renderer);
/* The current renderer info */
SDL_RendererInfo info;
/* The window associated with the renderer */
SDL_Window *window;
Feb 15, 2011
Feb 15, 2011
102
103
104
/* The drawable area within the window */
SDL_Rect viewport;
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/* The list of textures */
SDL_Texture *textures;
Uint8 r, g, b, a; /**< Color for drawing operations values */
SDL_BlendMode blendMode; /**< The drawing blend mode */
void *driverdata;
};
/* Define the SDL render driver structure */
struct SDL_RenderDriver
{
SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
/* Info about the renderer capabilities */
SDL_RendererInfo info;
};
Feb 8, 2011
Feb 8, 2011
124
125
#if !SDL_RENDER_DISABLED
126
127
128
129
130
131
#if SDL_VIDEO_RENDER_D3D
extern SDL_RenderDriver D3D_RenderDriver;
#endif
#if SDL_VIDEO_RENDER_OGL
extern SDL_RenderDriver GL_RenderDriver;
#endif
Feb 6, 2011
Feb 6, 2011
132
133
#if SDL_VIDEO_RENDER_OGL_ES2
extern SDL_RenderDriver GLES2_RenderDriver;
Feb 6, 2011
Feb 6, 2011
135
136
137
#if SDL_VIDEO_RENDER_OGL_ES
extern SDL_RenderDriver GLES_RenderDriver;
#endif
Feb 6, 2011
Feb 6, 2011
138
139
140
#if SDL_VIDEO_RENDER_DIRECTFB
extern SDL_RenderDriver DirectFB_RenderDriver;
#endif
Mar 7, 2011
Mar 7, 2011
141
142
143
#if SDL_VIDEO_RENDER_NDS
extern SDL_RenderDriver NDS_RenderDriver;
#endif
144
145
extern SDL_RenderDriver SW_RenderDriver;
Feb 8, 2011
Feb 8, 2011
146
147
#endif /* !SDL_RENDER_DISABLED */
148
149
150
#endif /* _SDL_sysrender_h */
/* vi: set ts=4 sw=4 expandtab: */