comparison src/video/photon/SDL_photon_render.c @ 3139:7f684f249ec9

indent
author Sam Lantinga <slouken@libsdl.org>
date Sat, 23 May 2009 22:41:08 +0000
parents aa1897bee1e9
children dd105b317335
comparison
equal deleted inserted replaced
3125:d71d8ceda8b3 3139:7f684f249ec9
32 #include "SDL_video.h" 32 #include "SDL_video.h"
33 33
34 #include "SDL_photon_render.h" 34 #include "SDL_photon_render.h"
35 #include "SDL_photon.h" 35 #include "SDL_photon.h"
36 36
37 static SDL_Renderer* photon_createrenderer(SDL_Window* window, Uint32 flags); 37 static SDL_Renderer *photon_createrenderer(SDL_Window * window, Uint32 flags);
38 static int photon_displaymodechanged(SDL_Renderer* renderer); 38 static int photon_displaymodechanged(SDL_Renderer * renderer);
39 static int photon_activaterenderer(SDL_Renderer* renderer); 39 static int photon_activaterenderer(SDL_Renderer * renderer);
40 static int photon_createtexture(SDL_Renderer* renderer, SDL_Texture* texture); 40 static int photon_createtexture(SDL_Renderer * renderer,
41 static int photon_querytexturepixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch); 41 SDL_Texture * texture);
42 static int photon_settexturepalette(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Color* colors, int firstcolor, int ncolors); 42 static int photon_querytexturepixels(SDL_Renderer * renderer,
43 static int photon_gettexturepalette(SDL_Renderer* renderer, SDL_Texture* texture, SDL_Color* colors, int firstcolor, int ncolors); 43 SDL_Texture * texture, void **pixels,
44 static int photon_settexturecolormod(SDL_Renderer* renderer, SDL_Texture* texture); 44 int *pitch);
45 static int photon_settexturealphamod(SDL_Renderer* renderer, SDL_Texture* texture); 45 static int photon_settexturepalette(SDL_Renderer * renderer,
46 static int photon_settextureblendmode(SDL_Renderer* renderer, SDL_Texture* texture); 46 SDL_Texture * texture,
47 static int photon_settexturescalemode(SDL_Renderer* renderer, SDL_Texture* texture); 47 const SDL_Color * colors, int firstcolor,
48 static int photon_updatetexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch); 48 int ncolors);
49 static int photon_locktexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int markDirty, void** pixels, int* pitch); 49 static int photon_gettexturepalette(SDL_Renderer * renderer,
50 static void photon_unlocktexture(SDL_Renderer* renderer, SDL_Texture* texture); 50 SDL_Texture * texture, SDL_Color * colors,
51 static void photon_dirtytexture(SDL_Renderer* renderer, SDL_Texture* texture, int numrects, const SDL_Rect* rects); 51 int firstcolor, int ncolors);
52 static int photon_renderpoint(SDL_Renderer* renderer, int x, int y); 52 static int photon_settexturecolormod(SDL_Renderer * renderer,
53 static int photon_renderline(SDL_Renderer* renderer, int x1, int y1, int x2, int y2); 53 SDL_Texture * texture);
54 static int photon_renderfill(SDL_Renderer* renderer, const SDL_Rect* rect); 54 static int photon_settexturealphamod(SDL_Renderer * renderer,
55 static int photon_rendercopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srcrect, const SDL_Rect* dstrect); 55 SDL_Texture * texture);
56 static void photon_renderpresent(SDL_Renderer* renderer); 56 static int photon_settextureblendmode(SDL_Renderer * renderer,
57 static void photon_destroytexture(SDL_Renderer* renderer, SDL_Texture* texture); 57 SDL_Texture * texture);
58 static void photon_destroyrenderer(SDL_Renderer* renderer); 58 static int photon_settexturescalemode(SDL_Renderer * renderer,
59 59 SDL_Texture * texture);
60 SDL_RenderDriver photon_renderdriver= 60 static int photon_updatetexture(SDL_Renderer * renderer,
61 { 61 SDL_Texture * texture, const SDL_Rect * rect,
62 const void *pixels, int pitch);
63 static int photon_locktexture(SDL_Renderer * renderer, SDL_Texture * texture,
64 const SDL_Rect * rect, int markDirty,
65 void **pixels, int *pitch);
66 static void photon_unlocktexture(SDL_Renderer * renderer,
67 SDL_Texture * texture);
68 static void photon_dirtytexture(SDL_Renderer * renderer,
69 SDL_Texture * texture, int numrects,
70 const SDL_Rect * rects);
71 static int photon_renderpoint(SDL_Renderer * renderer, int x, int y);
72 static int photon_renderline(SDL_Renderer * renderer, int x1, int y1, int x2,
73 int y2);
74 static int photon_renderfill(SDL_Renderer * renderer, const SDL_Rect * rect);
75 static int photon_rendercopy(SDL_Renderer * renderer, SDL_Texture * texture,
76 const SDL_Rect * srcrect,
77 const SDL_Rect * dstrect);
78 static void photon_renderpresent(SDL_Renderer * renderer);
79 static void photon_destroytexture(SDL_Renderer * renderer,
80 SDL_Texture * texture);
81 static void photon_destroyrenderer(SDL_Renderer * renderer);
82
83 SDL_RenderDriver photon_renderdriver = {
62 photon_createrenderer, 84 photon_createrenderer,
63 { 85 {
64 "photon", 86 "photon",
65 (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY | 87 (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
66 SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 | 88 SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
67 SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD | 89 SDL_RENDERER_PRESENTVSYNC | SDL_RENDERER_PRESENTDISCARD |
68 SDL_RENDERER_ACCELERATED), 90 SDL_RENDERER_ACCELERATED),
69 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR | 91 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
70 SDL_TEXTUREMODULATE_ALPHA), 92 SDL_TEXTUREMODULATE_ALPHA),
71 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | 93 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK |
72 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), 94 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD),
73 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW), 95 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_SLOW),
74 13, 96 13,
75 { 97 {
76 SDL_PIXELFORMAT_INDEX8, 98 SDL_PIXELFORMAT_INDEX8,
77 SDL_PIXELFORMAT_RGB555, 99 SDL_PIXELFORMAT_RGB555,
78 SDL_PIXELFORMAT_RGB565, 100 SDL_PIXELFORMAT_RGB565,
79 SDL_PIXELFORMAT_RGB888, 101 SDL_PIXELFORMAT_RGB888,
80 SDL_PIXELFORMAT_BGR888, 102 SDL_PIXELFORMAT_BGR888,
81 SDL_PIXELFORMAT_ARGB8888, 103 SDL_PIXELFORMAT_ARGB8888,
82 SDL_PIXELFORMAT_RGBA8888, 104 SDL_PIXELFORMAT_RGBA8888,
83 SDL_PIXELFORMAT_ABGR8888, 105 SDL_PIXELFORMAT_ABGR8888,
84 SDL_PIXELFORMAT_BGRA8888, 106 SDL_PIXELFORMAT_BGRA8888,
85 SDL_PIXELFORMAT_YV12, 107 SDL_PIXELFORMAT_YV12,
86 SDL_PIXELFORMAT_YUY2, 108 SDL_PIXELFORMAT_YUY2,
87 SDL_PIXELFORMAT_UYVY, 109 SDL_PIXELFORMAT_UYVY,
88 SDL_PIXELFORMAT_YVYU 110 SDL_PIXELFORMAT_YVYU},
89 }, 111 0,
90 0, 112 0}
91 0
92 }
93 }; 113 };
94 114
95 static SDL_Renderer* photon_createrenderer(SDL_Window* window, Uint32 flags) 115 static SDL_Renderer *
96 { 116 photon_createrenderer(SDL_Window * window, Uint32 flags)
97 SDL_VideoDisplay* display = SDL_GetDisplayFromWindow(window); 117 {
98 SDL_DisplayData* didata = (SDL_DisplayData*)display->driverdata; 118 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
99 SDL_WindowData* wdata = (SDL_WindowData*)window->driverdata; 119 SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
100 SDL_Renderer* renderer = NULL; 120 SDL_WindowData *wdata = (SDL_WindowData *) window->driverdata;
101 SDL_RenderData* rdata = NULL; 121 SDL_Renderer *renderer = NULL;
102 122 SDL_RenderData *rdata = NULL;
103 /* Allocate new renderer structure */ 123
104 renderer=(SDL_Renderer*)SDL_calloc(1, sizeof(SDL_Renderer)); 124 /* Allocate new renderer structure */
105 if (renderer==NULL) 125 renderer = (SDL_Renderer *) SDL_calloc(1, sizeof(SDL_Renderer));
106 { 126 if (renderer == NULL) {
107 SDL_OutOfMemory(); 127 SDL_OutOfMemory();
108 return NULL; 128 return NULL;
109 } 129 }
110 130
111 /* Allocate renderer data */ 131 /* Allocate renderer data */
112 rdata=(SDL_RenderData*)SDL_calloc(1, sizeof(SDL_RenderData)); 132 rdata = (SDL_RenderData *) SDL_calloc(1, sizeof(SDL_RenderData));
113 if (rdata==NULL) 133 if (rdata == NULL) {
114 { 134 SDL_free(renderer);
115 SDL_free(renderer); 135 SDL_OutOfMemory();
116 SDL_OutOfMemory(); 136 return NULL;
117 return NULL; 137 }
118 } 138
119 139 renderer->DisplayModeChanged = photon_displaymodechanged;
120 renderer->DisplayModeChanged=photon_displaymodechanged; 140 renderer->ActivateRenderer = photon_activaterenderer;
121 renderer->ActivateRenderer=photon_activaterenderer; 141 renderer->CreateTexture = photon_createtexture;
122 renderer->CreateTexture=photon_createtexture; 142 renderer->QueryTexturePixels = photon_querytexturepixels;
123 renderer->QueryTexturePixels=photon_querytexturepixels; 143 renderer->SetTexturePalette = photon_settexturepalette;
124 renderer->SetTexturePalette=photon_settexturepalette; 144 renderer->GetTexturePalette = photon_gettexturepalette;
125 renderer->GetTexturePalette=photon_gettexturepalette; 145 renderer->SetTextureAlphaMod = photon_settexturealphamod;
126 renderer->SetTextureAlphaMod=photon_settexturealphamod; 146 renderer->SetTextureColorMod = photon_settexturecolormod;
127 renderer->SetTextureColorMod=photon_settexturecolormod; 147 renderer->SetTextureBlendMode = photon_settextureblendmode;
128 renderer->SetTextureBlendMode=photon_settextureblendmode; 148 renderer->SetTextureScaleMode = photon_settexturescalemode;
129 renderer->SetTextureScaleMode=photon_settexturescalemode; 149 renderer->UpdateTexture = photon_updatetexture;
130 renderer->UpdateTexture=photon_updatetexture; 150 renderer->LockTexture = photon_locktexture;
131 renderer->LockTexture=photon_locktexture; 151 renderer->UnlockTexture = photon_unlocktexture;
132 renderer->UnlockTexture=photon_unlocktexture; 152 renderer->DirtyTexture = photon_dirtytexture;
133 renderer->DirtyTexture=photon_dirtytexture; 153 renderer->RenderPoint = photon_renderpoint;
134 renderer->RenderPoint=photon_renderpoint; 154 renderer->RenderLine = photon_renderline;
135 renderer->RenderLine=photon_renderline; 155 renderer->RenderFill = photon_renderfill;
136 renderer->RenderFill=photon_renderfill; 156 renderer->RenderCopy = photon_rendercopy;
137 renderer->RenderCopy=photon_rendercopy; 157 renderer->RenderPresent = photon_renderpresent;
138 renderer->RenderPresent = photon_renderpresent; 158 renderer->DestroyTexture = photon_destroytexture;
139 renderer->DestroyTexture = photon_destroytexture; 159 renderer->DestroyRenderer = photon_destroyrenderer;
140 renderer->DestroyRenderer = photon_destroyrenderer; 160 renderer->info = photon_renderdriver.info;
141 renderer->info = photon_renderdriver.info; 161 renderer->window = window->id;
142 renderer->window = window->id; 162 renderer->driverdata = rdata;
143 renderer->driverdata = rdata; 163
144 164 /* Set render acceleration flag in case it is accelerated */
145 /* Set render acceleration flag in case it is accelerated */ 165 if ((didata->caps & SDL_PHOTON_ACCELERATED) == SDL_PHOTON_ACCELERATED) {
146 if ((didata->caps & SDL_PHOTON_ACCELERATED)==SDL_PHOTON_ACCELERATED) 166 renderer->info.flags = SDL_RENDERER_ACCELERATED;
147 { 167 } else {
148 renderer->info.flags=SDL_RENDERER_ACCELERATED; 168 renderer->info.flags &= ~(SDL_RENDERER_ACCELERATED);
149 } 169 }
150 else 170
151 { 171 rdata->window = window;
152 renderer->info.flags&=~(SDL_RENDERER_ACCELERATED); 172
153 } 173 /* Check if upper level requested synchronization on vsync signal */
154 174 if ((flags & SDL_RENDERER_PRESENTVSYNC) == SDL_RENDERER_PRESENTVSYNC) {
155 rdata->window=window; 175 rdata->enable_vsync = SDL_TRUE;
156 176 } else {
157 /* Check if upper level requested synchronization on vsync signal */ 177 rdata->enable_vsync = SDL_FALSE;
158 if ((flags & SDL_RENDERER_PRESENTVSYNC)==SDL_RENDERER_PRESENTVSYNC) 178 }
159 { 179
160 rdata->enable_vsync=SDL_TRUE; 180 /* Check what buffer copy/flip scheme is requested */
161 } 181 rdata->surfaces_count = 0;
162 else 182 if ((flags & SDL_RENDERER_SINGLEBUFFER) == SDL_RENDERER_SINGLEBUFFER) {
163 { 183 if ((flags & SDL_RENDERER_PRESENTDISCARD) ==
164 rdata->enable_vsync=SDL_FALSE; 184 SDL_RENDERER_PRESENTDISCARD) {
165 } 185 renderer->info.flags |=
166 186 SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD;
167 /* Check what buffer copy/flip scheme is requested */ 187 } else {
168 rdata->surfaces_count=0; 188 renderer->info.flags |=
169 if ((flags & SDL_RENDERER_SINGLEBUFFER)==SDL_RENDERER_SINGLEBUFFER) 189 SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY;
170 { 190 }
171 if ((flags & SDL_RENDERER_PRESENTDISCARD)==SDL_RENDERER_PRESENTDISCARD) 191 rdata->surfaces_count = 1;
172 { 192 rdata->surface_visible_idx = 0;
173 renderer->info.flags|=SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTDISCARD; 193 rdata->surface_render_idx = 0;
174 } 194 } else {
175 else 195 if ((flags & SDL_RENDERER_PRESENTFLIP2) == SDL_RENDERER_PRESENTFLIP2) {
176 { 196 renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2;
177 renderer->info.flags|=SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY; 197 rdata->surfaces_count = 2;
178 } 198 rdata->surface_visible_idx = 0;
179 rdata->surfaces_count=1; 199 rdata->surface_render_idx = 1;
180 rdata->surface_visible_idx=0; 200 } else {
181 rdata->surface_render_idx=0; 201 if ((flags & SDL_RENDERER_PRESENTFLIP3) ==
182 } 202 SDL_RENDERER_PRESENTFLIP3) {
183 else 203 renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3;
184 { 204 rdata->surfaces_count = 3;
185 if ((flags & SDL_RENDERER_PRESENTFLIP2)==SDL_RENDERER_PRESENTFLIP2) 205 rdata->surface_visible_idx = 0;
186 { 206 rdata->surface_render_idx = 1;
187 renderer->info.flags|=SDL_RENDERER_PRESENTFLIP2; 207 } else {
188 rdata->surfaces_count=2; 208 renderer->info.flags |=
189 rdata->surface_visible_idx=0; 209 SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY;
190 rdata->surface_render_idx=1; 210 rdata->surfaces_count = 1;
191 } 211 rdata->surface_visible_idx = 0;
192 else 212 rdata->surface_render_idx = 0;
193 { 213 }
194 if ((flags & SDL_RENDERER_PRESENTFLIP3)==SDL_RENDERER_PRESENTFLIP3) 214 }
195 { 215 }
196 renderer->info.flags|=SDL_RENDERER_PRESENTFLIP3; 216
197 rdata->surfaces_count=3; 217 return renderer;
198 rdata->surface_visible_idx=0; 218 }
199 rdata->surface_render_idx=1; 219
200 } 220 void
201 else 221 photon_addrenderdriver(_THIS)
202 { 222 {
203 renderer->info.flags|=SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY; 223 uint32_t it;
204 rdata->surfaces_count=1; 224
205 rdata->surface_visible_idx=0; 225 for (it = 0; it < _this->num_displays; it++) {
206 rdata->surface_render_idx=0; 226 SDL_AddRenderDriver(it, &photon_renderdriver);
207 } 227 }
208 }
209 }
210
211 return renderer;
212 }
213
214 void photon_addrenderdriver(_THIS)
215 {
216 uint32_t it;
217
218 for (it=0; it<_this->num_displays; it++)
219 {
220 SDL_AddRenderDriver(it, &photon_renderdriver);
221 }
222 } 228 }
223 229
224 /****************************************************************************/ 230 /****************************************************************************/
225 /* SDL render interface */ 231 /* SDL render interface */
226 /****************************************************************************/ 232 /****************************************************************************/
227 static int photon_displaymodechanged(SDL_Renderer* renderer) 233 static int
228 { 234 photon_displaymodechanged(SDL_Renderer * renderer)
229 SDL_RenderData* rdata=(SDL_RenderData*)renderer->driverdata; 235 {
230 236 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
231 /* Remove all allocated surfaces, they are no more valid */ 237
232 238 /* Remove all allocated surfaces, they are no more valid */
233 /* TODO: Add video mode change detection and new parameters detection */ 239
234 240 /* TODO: Add video mode change detection and new parameters detection */
235 return 0; 241
236 } 242 return 0;
237 243 }
238 static int photon_activaterenderer(SDL_Renderer* renderer) 244
239 { 245 static int
240 SDL_RenderData* rdata=(SDL_RenderData*)renderer->driverdata; 246 photon_activaterenderer(SDL_Renderer * renderer)
241 SDL_VideoDisplay* display = SDL_GetDisplayFromWindow(rdata->window); 247 {
242 SDL_DisplayData* didata = (SDL_DisplayData*)display->driverdata; 248 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
243 249 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(rdata->window);
244 return 0; 250 SDL_DisplayData *didata = (SDL_DisplayData *) display->driverdata;
245 } 251
246 252 return 0;
247 static int photon_createtexture(SDL_Renderer* renderer, SDL_Texture* texture) 253 }
248 { 254
249 SDL_RenderData* renderdata=(SDL_RenderData*)renderer->driverdata; 255 static int
250 SDL_Window* window=SDL_GetWindowFromID(renderer->window); 256 photon_createtexture(SDL_Renderer * renderer, SDL_Texture * texture)
251 SDL_VideoDisplay* display=SDL_GetDisplayFromWindow(window); 257 {
252 SDL_TextureData* tdata=NULL; 258 SDL_RenderData *renderdata = (SDL_RenderData *) renderer->driverdata;
253 259 SDL_Window *window = SDL_GetWindowFromID(renderer->window);
254 /* Allocate texture driver data */ 260 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
255 tdata=(SDL_TextureData*)SDL_calloc(1, sizeof(SDL_TextureData)); 261 SDL_TextureData *tdata = NULL;
256 if (tdata==NULL) 262
257 { 263 /* Allocate texture driver data */
258 SDL_OutOfMemory(); 264 tdata = (SDL_TextureData *) SDL_calloc(1, sizeof(SDL_TextureData));
259 return -1; 265 if (tdata == NULL) {
260 } 266 SDL_OutOfMemory();
261 267 return -1;
262 /* Set texture driver data */ 268 }
263 texture->driverdata=tdata; 269
264 270 /* Set texture driver data */
265 } 271 texture->driverdata = tdata;
266 272
267 static int photon_querytexturepixels(SDL_Renderer* renderer, SDL_Texture* texture, void** pixels, int* pitch) 273 }
268 { 274
269 } 275 static int
270 276 photon_querytexturepixels(SDL_Renderer * renderer, SDL_Texture * texture,
271 static int photon_settexturepalette(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Color* colors, int firstcolor, int ncolors) 277 void **pixels, int *pitch)
272 { 278 {
273 } 279 }
274 280
275 static int photon_gettexturepalette(SDL_Renderer* renderer, SDL_Texture* texture, SDL_Color* colors, int firstcolor, int ncolors) 281 static int
276 { 282 photon_settexturepalette(SDL_Renderer * renderer, SDL_Texture * texture,
277 } 283 const SDL_Color * colors, int firstcolor,
278 284 int ncolors)
279 static int photon_settexturecolormod(SDL_Renderer* renderer, SDL_Texture* texture) 285 {
280 { 286 }
281 } 287
282 288 static int
283 static int photon_settexturealphamod(SDL_Renderer* renderer, SDL_Texture* texture) 289 photon_gettexturepalette(SDL_Renderer * renderer, SDL_Texture * texture,
284 { 290 SDL_Color * colors, int firstcolor, int ncolors)
285 } 291 {
286 292 }
287 static int photon_settextureblendmode(SDL_Renderer* renderer, SDL_Texture* texture) 293
288 { 294 static int
289 } 295 photon_settexturecolormod(SDL_Renderer * renderer, SDL_Texture * texture)
290 296 {
291 static int photon_settexturescalemode(SDL_Renderer* renderer, SDL_Texture* texture) 297 }
292 { 298
293 } 299 static int
294 300 photon_settexturealphamod(SDL_Renderer * renderer, SDL_Texture * texture)
295 static int photon_updatetexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, const void* pixels, int pitch) 301 {
296 { 302 }
297 } 303
298 304 static int
299 static int photon_locktexture(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* rect, int markDirty, void** pixels, int* pitch) 305 photon_settextureblendmode(SDL_Renderer * renderer, SDL_Texture * texture)
300 { 306 {
301 } 307 }
302 308
303 static void photon_unlocktexture(SDL_Renderer* renderer, SDL_Texture* texture) 309 static int
304 { 310 photon_settexturescalemode(SDL_Renderer * renderer, SDL_Texture * texture)
305 } 311 {
306 312 }
307 static void photon_dirtytexture(SDL_Renderer* renderer, SDL_Texture* texture, int numrects, const SDL_Rect* rects) 313
308 { 314 static int
309 } 315 photon_updatetexture(SDL_Renderer * renderer, SDL_Texture * texture,
310 316 const SDL_Rect * rect, const void *pixels, int pitch)
311 static int photon_renderpoint(SDL_Renderer* renderer, int x, int y) 317 {
312 { 318 }
313 } 319
314 320 static int
315 static int photon_renderline(SDL_Renderer* renderer, int x1, int y1, int x2, int y2) 321 photon_locktexture(SDL_Renderer * renderer, SDL_Texture * texture,
316 { 322 const SDL_Rect * rect, int markDirty, void **pixels,
317 } 323 int *pitch)
318 324 {
319 static int photon_renderfill(SDL_Renderer* renderer, const SDL_Rect* rect) 325 }
320 { 326
321 } 327 static void
322 328 photon_unlocktexture(SDL_Renderer * renderer, SDL_Texture * texture)
323 static int photon_rendercopy(SDL_Renderer* renderer, SDL_Texture* texture, const SDL_Rect* srcrect, const SDL_Rect* dstrect) 329 {
324 { 330 }
325 } 331
326 332 static void
327 static void photon_renderpresent(SDL_Renderer* renderer) 333 photon_dirtytexture(SDL_Renderer * renderer, SDL_Texture * texture,
328 { 334 int numrects, const SDL_Rect * rects)
329 } 335 {
330 336 }
331 static void photon_destroytexture(SDL_Renderer* renderer, SDL_Texture* texture) 337
332 { 338 static int
333 } 339 photon_renderpoint(SDL_Renderer * renderer, int x, int y)
334 340 {
335 static void photon_destroyrenderer(SDL_Renderer* renderer) 341 }
336 { 342
337 SDL_RenderData* rdata=(SDL_RenderData*)renderer->driverdata; 343 static int
338 uint32_t it; 344 photon_renderline(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
345 {
346 }
347
348 static int
349 photon_renderfill(SDL_Renderer * renderer, const SDL_Rect * rect)
350 {
351 }
352
353 static int
354 photon_rendercopy(SDL_Renderer * renderer, SDL_Texture * texture,
355 const SDL_Rect * srcrect, const SDL_Rect * dstrect)
356 {
357 }
358
359 static void
360 photon_renderpresent(SDL_Renderer * renderer)
361 {
362 }
363
364 static void
365 photon_destroytexture(SDL_Renderer * renderer, SDL_Texture * texture)
366 {
367 }
368
369 static void
370 photon_destroyrenderer(SDL_Renderer * renderer)
371 {
372 SDL_RenderData *rdata = (SDL_RenderData *) renderer->driverdata;
373 uint32_t it;
339 374
340 } 375 }
341 376
342 /* vi: set ts=4 sw=4 expandtab: */ 377 /* vi: set ts=4 sw=4 expandtab: */