comparison src/video/win32/SDL_gdirender.c @ 2927:2133d2d300fd

SetDrawColor() and SetDrawBlendMode() are optional
author Sam Lantinga <slouken@libsdl.org>
date Tue, 30 Dec 2008 07:14:11 +0000
parents 27f2b5e7e899
children 81fc47035302
comparison
equal deleted inserted replaced
2926:27f2b5e7e899 2927:2133d2d300fd
53 int pitch); 53 int pitch);
54 static int GDI_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture, 54 static int GDI_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
55 const SDL_Rect * rect, int markDirty, 55 const SDL_Rect * rect, int markDirty,
56 void **pixels, int *pitch); 56 void **pixels, int *pitch);
57 static void GDI_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture); 57 static void GDI_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
58 static int GDI_SetDrawBlendMode(SDL_Renderer * renderer);
58 static int GDI_RenderPoint(SDL_Renderer * renderer, int x, int y); 59 static int GDI_RenderPoint(SDL_Renderer * renderer, int x, int y);
59 static int GDI_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2, 60 static int GDI_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2,
60 int y2); 61 int y2);
61 static int GDI_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect); 62 static int GDI_RenderFill(SDL_Renderer * renderer, const SDL_Rect * rect);
62 static int GDI_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, 63 static int GDI_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
173 renderer->SetTextureBlendMode = GDI_SetTextureBlendMode; 174 renderer->SetTextureBlendMode = GDI_SetTextureBlendMode;
174 renderer->SetTextureScaleMode = GDI_SetTextureScaleMode; 175 renderer->SetTextureScaleMode = GDI_SetTextureScaleMode;
175 renderer->UpdateTexture = GDI_UpdateTexture; 176 renderer->UpdateTexture = GDI_UpdateTexture;
176 renderer->LockTexture = GDI_LockTexture; 177 renderer->LockTexture = GDI_LockTexture;
177 renderer->UnlockTexture = GDI_UnlockTexture; 178 renderer->UnlockTexture = GDI_UnlockTexture;
179 renderer->SetDrawBlendMode = GDI_SetDrawBlendMode;
178 renderer->RenderPoint = GDI_RenderPoint; 180 renderer->RenderPoint = GDI_RenderPoint;
179 renderer->RenderLine = GDI_RenderLine; 181 renderer->RenderLine = GDI_RenderLine;
180 renderer->RenderFill = GDI_RenderFill; 182 renderer->RenderFill = GDI_RenderFill;
181 renderer->RenderCopy = GDI_RenderCopy; 183 renderer->RenderCopy = GDI_RenderCopy;
182 renderer->RenderPresent = GDI_RenderPresent; 184 renderer->RenderPresent = GDI_RenderPresent;
572 UpdateYUVTextureData(texture); 574 UpdateYUVTextureData(texture);
573 } 575 }
574 } 576 }
575 577
576 static int 578 static int
579 GDI_SetDrawBlendMode(SDL_Renderer * renderer)
580 {
581 switch (renderer->blendMode) {
582 case SDL_BLENDMODE_NONE:
583 return 0;
584 default:
585 SDL_Unsupported();
586 renderer->blendMode = SDL_BLENDMODE_NONE;
587 return -1;
588 }
589 }
590
591 static int
577 GDI_RenderPoint(SDL_Renderer * renderer, int x, int y) 592 GDI_RenderPoint(SDL_Renderer * renderer, int x, int y)
578 { 593 {
579 GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata; 594 GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata;
580 595
581 if (data->makedirty) { 596 if (data->makedirty) {