comparison src/video/SDL_renderer_sw.c @ 5144:31e7f523ab3d

Making the API simpler, texture color and alpha modulation are supported by all renderers.
author Sam Lantinga <slouken@libsdl.org>
date Mon, 31 Jan 2011 23:37:30 -0800
parents e743b9c3f6d6
children c8e049de174c
comparison
equal deleted inserted replaced
5143:e743b9c3f6d6 5144:31e7f523ab3d
47 int firstcolor, int ncolors); 47 int firstcolor, int ncolors);
48 static int SW_SetTextureColorMod(SDL_Renderer * renderer, 48 static int SW_SetTextureColorMod(SDL_Renderer * renderer,
49 SDL_Texture * texture); 49 SDL_Texture * texture);
50 static int SW_SetTextureAlphaMod(SDL_Renderer * renderer, 50 static int SW_SetTextureAlphaMod(SDL_Renderer * renderer,
51 SDL_Texture * texture); 51 SDL_Texture * texture);
52 static int SW_SetTextureBlendMode(SDL_Renderer * renderer,
53 SDL_Texture * texture);
52 static int SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, 54 static int SW_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture,
53 const SDL_Rect * rect, const void *pixels, 55 const SDL_Rect * rect, const void *pixels,
54 int pitch); 56 int pitch);
55 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, 57 static int SW_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
56 const SDL_Rect * rect, int markDirty, void **pixels, 58 const SDL_Rect * rect, int markDirty, void **pixels,
80 { 82 {
81 "software", 83 "software",
82 (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY | 84 (SDL_RENDERER_SINGLEBUFFER | SDL_RENDERER_PRESENTCOPY |
83 SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 | 85 SDL_RENDERER_PRESENTFLIP2 | SDL_RENDERER_PRESENTFLIP3 |
84 SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC), 86 SDL_RENDERER_PRESENTDISCARD | SDL_RENDERER_PRESENTVSYNC),
85 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR |
86 SDL_TEXTUREMODULATE_ALPHA),
87 14, 87 14,
88 { 88 {
89 SDL_PIXELFORMAT_INDEX8, 89 SDL_PIXELFORMAT_INDEX8,
90 SDL_PIXELFORMAT_RGB555, 90 SDL_PIXELFORMAT_RGB555,
91 SDL_PIXELFORMAT_RGB565, 91 SDL_PIXELFORMAT_RGB565,
170 renderer->QueryTexturePixels = SW_QueryTexturePixels; 170 renderer->QueryTexturePixels = SW_QueryTexturePixels;
171 renderer->SetTexturePalette = SW_SetTexturePalette; 171 renderer->SetTexturePalette = SW_SetTexturePalette;
172 renderer->GetTexturePalette = SW_GetTexturePalette; 172 renderer->GetTexturePalette = SW_GetTexturePalette;
173 renderer->SetTextureColorMod = SW_SetTextureColorMod; 173 renderer->SetTextureColorMod = SW_SetTextureColorMod;
174 renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod; 174 renderer->SetTextureAlphaMod = SW_SetTextureAlphaMod;
175 renderer->SetTextureBlendMode = SW_SetTextureBlendMode;
175 renderer->UpdateTexture = SW_UpdateTexture; 176 renderer->UpdateTexture = SW_UpdateTexture;
176 renderer->LockTexture = SW_LockTexture; 177 renderer->LockTexture = SW_LockTexture;
177 renderer->UnlockTexture = SW_UnlockTexture; 178 renderer->UnlockTexture = SW_UnlockTexture;
178 renderer->DestroyTexture = SW_DestroyTexture; 179 renderer->DestroyTexture = SW_DestroyTexture;
179 180
180 renderer->info.mod_modes = SW_RenderDriver.info.mod_modes;
181 renderer->info.num_texture_formats = 181 renderer->info.num_texture_formats =
182 SW_RenderDriver.info.num_texture_formats; 182 SW_RenderDriver.info.num_texture_formats;
183 SDL_memcpy(renderer->info.texture_formats, 183 SDL_memcpy(renderer->info.texture_formats,
184 SW_RenderDriver.info.texture_formats, 184 SW_RenderDriver.info.texture_formats,
185 sizeof(renderer->info.texture_formats));; 185 sizeof(renderer->info.texture_formats));;