Mercurial > sdl-ios-xcode
comparison src/video/dummy/SDL_nullrender.c @ 1965:a788656ca29a
SDL constants are all uppercase.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sat, 05 Aug 2006 17:09:42 +0000 |
parents | 8d384b647307 |
children | 8055185ae4ed |
comparison
equal
deleted
inserted
replaced
1964:071b6598d48f | 1965:a788656ca29a |
---|---|
78 | 78 |
79 SDL_RenderDriver SDL_DUMMY_RenderDriver = { | 79 SDL_RenderDriver SDL_DUMMY_RenderDriver = { |
80 SDL_DUMMY_CreateRenderer, | 80 SDL_DUMMY_CreateRenderer, |
81 { | 81 { |
82 "dummy", | 82 "dummy", |
83 (SDL_Renderer_SingleBuffer | SDL_Renderer_PresentCopy | | 83 (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY | |
84 SDL_Renderer_PresentFlip2 | SDL_Renderer_PresentFlip3 | | 84 SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 | |
85 SDL_Renderer_PresentDiscard), | 85 SDL_RENDERER_PRESENTDISCARD), |
86 (SDL_TextureBlendMode_None | SDL_TextureBlendMode_Mask | | 86 (SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK | |
87 SDL_TextureBlendMode_Blend), | 87 SDL_TEXTUREBLENDMODE_BLEND), |
88 (SDL_TextureScaleMode_None | SDL_TextureScaleMode_Fast), | 88 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST), |
89 11, | 89 11, |
90 { | 90 { |
91 SDL_PixelFormat_Index8, | 91 SDL_PIXELFORMAT_INDEX8, |
92 SDL_PixelFormat_RGB555, | 92 SDL_PIXELFORMAT_RGB555, |
93 SDL_PixelFormat_RGB565, | 93 SDL_PIXELFORMAT_RGB565, |
94 SDL_PixelFormat_RGB888, | 94 SDL_PIXELFORMAT_RGB888, |
95 SDL_PixelFormat_BGR888, | 95 SDL_PIXELFORMAT_BGR888, |
96 SDL_PixelFormat_ARGB8888, | 96 SDL_PIXELFORMAT_ARGB8888, |
97 SDL_PixelFormat_RGBA8888, | 97 SDL_PIXELFORMAT_RGBA8888, |
98 SDL_PixelFormat_ABGR8888, | 98 SDL_PIXELFORMAT_ABGR8888, |
99 SDL_PixelFormat_BGRA8888, | 99 SDL_PIXELFORMAT_BGRA8888, |
100 SDL_PixelFormat_YUY2, | 100 SDL_PIXELFORMAT_YUY2, |
101 SDL_PixelFormat_UYVY}, | 101 SDL_PIXELFORMAT_UYVY}, |
102 0, | 102 0, |
103 0} | 103 0} |
104 }; | 104 }; |
105 | 105 |
106 typedef struct | 106 typedef struct |
157 renderer->window = window->id; | 157 renderer->window = window->id; |
158 renderer->driverdata = data; | 158 renderer->driverdata = data; |
159 | 159 |
160 renderer->info.flags = 0; | 160 renderer->info.flags = 0; |
161 | 161 |
162 if (flags & SDL_Renderer_PresentFlip2) { | 162 if (flags & SDL_RENDERER_PRESENTFLIP2) { |
163 renderer->info.flags |= SDL_Renderer_PresentFlip2; | 163 renderer->info.flags |= SDL_RENDERER_PRESENTFLIP2; |
164 n = 2; | 164 n = 2; |
165 } else if (flags & SDL_Renderer_PresentFlip3) { | 165 } else if (flags & SDL_RENDERER_PRESENTFLIP3) { |
166 renderer->info.flags |= SDL_Renderer_PresentFlip3; | 166 renderer->info.flags |= SDL_RENDERER_PRESENTFLIP3; |
167 n = 3; | 167 n = 3; |
168 } else { | 168 } else { |
169 renderer->info.flags |= SDL_Renderer_PresentCopy; | 169 renderer->info.flags |= SDL_RENDERER_PRESENTCOPY; |
170 n = 1; | 170 n = 1; |
171 } | 171 } |
172 for (i = 0; i < n; ++i) { | 172 for (i = 0; i < n; ++i) { |
173 data->screens[i] = | 173 data->screens[i] = |
174 SDL_CreateRGBSurface(0, window->w, window->h, bpp, Rmask, Gmask, | 174 SDL_CreateRGBSurface(0, window->w, window->h, bpp, Rmask, Gmask, |
362 SDL_Surface *target = data->screens[data->current_screen]; | 362 SDL_Surface *target = data->screens[data->current_screen]; |
363 SDL_Rect real_srcrect = *srcrect; | 363 SDL_Rect real_srcrect = *srcrect; |
364 SDL_Rect real_dstrect = *dstrect; | 364 SDL_Rect real_dstrect = *dstrect; |
365 | 365 |
366 if (blendMode & | 366 if (blendMode & |
367 (SDL_TextureBlendMode_Mask | SDL_TextureBlendMode_Blend)) { | 367 (SDL_TEXTUREBLENDMODE_MASK | SDL_TEXTUREBLENDMODE_BLEND)) { |
368 SDL_SetAlpha(surface, SDL_SRCALPHA, 0); | 368 SDL_SetAlpha(surface, SDL_SRCALPHA, 0); |
369 } else { | 369 } else { |
370 SDL_SetAlpha(surface, 0, 0); | 370 SDL_SetAlpha(surface, 0, 0); |
371 } | 371 } |
372 if (scaleMode != SDL_TextureScaleMode_None && | 372 if (scaleMode != SDL_TEXTURESCALEMODE_NONE && |
373 (srcrect->w != dstrect->w || srcrect->h != dstrect->h)) { | 373 (srcrect->w != dstrect->w || srcrect->h != dstrect->h)) { |
374 return SDL_SoftStretch(surface, &real_srcrect, target, | 374 return SDL_SoftStretch(surface, &real_srcrect, target, |
375 &real_dstrect); | 375 &real_dstrect); |
376 } else { | 376 } else { |
377 return SDL_LowerBlit(surface, &real_srcrect, target, | 377 return SDL_LowerBlit(surface, &real_srcrect, target, |
394 renderer->window, ++frame_number); | 394 renderer->window, ++frame_number); |
395 SDL_SaveBMP(data->screens[data->current_screen], file); | 395 SDL_SaveBMP(data->screens[data->current_screen], file); |
396 } | 396 } |
397 | 397 |
398 /* Update the flipping chain, if any */ | 398 /* Update the flipping chain, if any */ |
399 if (renderer->info.flags & SDL_Renderer_PresentFlip2) { | 399 if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) { |
400 data->current_screen = (data->current_screen + 1) % 2; | 400 data->current_screen = (data->current_screen + 1) % 2; |
401 } else if (renderer->info.flags & SDL_Renderer_PresentFlip3) { | 401 } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP3) { |
402 data->current_screen = (data->current_screen + 1) % 3; | 402 data->current_screen = (data->current_screen + 1) % 3; |
403 } | 403 } |
404 } | 404 } |
405 | 405 |
406 static void | 406 static void |