comparison src/video/SDL_renderer_sw.c @ 2810:27cb878a278e

Implemented the X11 (non-OpenGL) renderer, no alpha or scaling available.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 30 Nov 2008 21:58:23 +0000
parents c2834344ca44
children 7af2419ad5b0
comparison
equal deleted inserted replaced
2809:7e257c3a3bf0 2810:27cb878a278e
57 int pitch); 57 int pitch);
58 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, 58 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
59 const SDL_Rect * rect, int markDirty, void **pixels, 59 const SDL_Rect * rect, int markDirty, void **pixels,
60 int *pitch); 60 int *pitch);
61 static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture); 61 static void SW_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
62 static void SW_DirtyTexture(SDL_Renderer * renderer,
63 SDL_Texture * texture, int numrects,
64 const SDL_Rect * rects);
65 static int SW_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b, 62 static int SW_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b,
66 Uint8 a, const SDL_Rect * rect); 63 Uint8 a, const SDL_Rect * rect);
67 static int SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, 64 static int SW_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
68 const SDL_Rect * srcrect, const SDL_Rect * dstrect); 65 const SDL_Rect * srcrect, const SDL_Rect * dstrect);
69 static void SW_RenderPresent(SDL_Renderer * renderer); 66 static void SW_RenderPresent(SDL_Renderer * renderer);
82 SDL_TEXTUREMODULATE_ALPHA), 79 SDL_TEXTUREMODULATE_ALPHA),
83 (SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK | 80 (SDL_TEXTUREBLENDMODE_NONE | SDL_TEXTUREBLENDMODE_MASK |
84 SDL_TEXTUREBLENDMODE_BLEND | SDL_TEXTUREBLENDMODE_ADD | 81 SDL_TEXTUREBLENDMODE_BLEND | SDL_TEXTUREBLENDMODE_ADD |
85 SDL_TEXTUREBLENDMODE_MOD), 82 SDL_TEXTUREBLENDMODE_MOD),
86 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST), 83 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST),
87 11, 84 12,
88 { 85 {
89 SDL_PIXELFORMAT_INDEX8, 86 SDL_PIXELFORMAT_INDEX8,
90 SDL_PIXELFORMAT_RGB555, 87 SDL_PIXELFORMAT_RGB555,
91 SDL_PIXELFORMAT_RGB565, 88 SDL_PIXELFORMAT_RGB565,
92 SDL_PIXELFORMAT_RGB888, 89 SDL_PIXELFORMAT_RGB888,
94 SDL_PIXELFORMAT_ARGB8888, 91 SDL_PIXELFORMAT_ARGB8888,
95 SDL_PIXELFORMAT_RGBA8888, 92 SDL_PIXELFORMAT_RGBA8888,
96 SDL_PIXELFORMAT_ABGR8888, 93 SDL_PIXELFORMAT_ABGR8888,
97 SDL_PIXELFORMAT_BGRA8888, 94 SDL_PIXELFORMAT_BGRA8888,
98 SDL_PIXELFORMAT_YUY2, 95 SDL_PIXELFORMAT_YUY2,
99 SDL_PIXELFORMAT_UYVY}, 96 SDL_PIXELFORMAT_UYVY,
97 SDL_PIXELFORMAT_YVYU},
100 0, 98 0,
101 0} 99 0}
102 }; 100 };
103 101
104 typedef struct 102 typedef struct
172 renderer->SetTextureBlendMode = SW_SetTextureBlendMode; 170 renderer->SetTextureBlendMode = SW_SetTextureBlendMode;
173 renderer->SetTextureScaleMode = SW_SetTextureScaleMode; 171 renderer->SetTextureScaleMode = SW_SetTextureScaleMode;
174 renderer->UpdateTexture = SW_UpdateTexture; 172 renderer->UpdateTexture = SW_UpdateTexture;
175 renderer->LockTexture = SW_LockTexture; 173 renderer->LockTexture = SW_LockTexture;
176 renderer->UnlockTexture = SW_UnlockTexture; 174 renderer->UnlockTexture = SW_UnlockTexture;
177 renderer->DirtyTexture = SW_DirtyTexture;
178 renderer->DestroyTexture = SW_DestroyTexture; 175 renderer->DestroyTexture = SW_DestroyTexture;
179 176
180 renderer->info.mod_modes = SW_RenderDriver.info.mod_modes; 177 renderer->info.mod_modes = SW_RenderDriver.info.mod_modes;
181 renderer->info.blend_modes = SW_RenderDriver.info.blend_modes; 178 renderer->info.blend_modes = SW_RenderDriver.info.blend_modes;
182 renderer->info.scale_modes = SW_RenderDriver.info.scale_modes; 179 renderer->info.scale_modes = SW_RenderDriver.info.scale_modes;
518 if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) { 515 if (SDL_ISPIXELFORMAT_FOURCC(texture->format)) {
519 SDL_SW_UnlockYUVTexture((SDL_SW_YUVTexture *) texture->driverdata); 516 SDL_SW_UnlockYUVTexture((SDL_SW_YUVTexture *) texture->driverdata);
520 } 517 }
521 } 518 }
522 519
523 static void
524 SW_DirtyTexture(SDL_Renderer * renderer, SDL_Texture * texture,
525 int numrects, const SDL_Rect * rects)
526 {
527 }
528
529 static int 520 static int
530 SW_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a, 521 SW_RenderFill(SDL_Renderer * renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a,
531 const SDL_Rect * rect) 522 const SDL_Rect * rect)
532 { 523 {
533 SW_RenderData *data = (SW_RenderData *) renderer->driverdata; 524 SW_RenderData *data = (SW_RenderData *) renderer->driverdata;