diff 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
line wrap: on
line diff
--- a/src/video/win32/SDL_gdirender.c	Tue Dec 30 04:38:39 2008 +0000
+++ b/src/video/win32/SDL_gdirender.c	Tue Dec 30 07:14:11 2008 +0000
@@ -55,6 +55,7 @@
                            const SDL_Rect * rect, int markDirty,
                            void **pixels, int *pitch);
 static void GDI_UnlockTexture(SDL_Renderer * renderer, SDL_Texture * texture);
+static int GDI_SetDrawBlendMode(SDL_Renderer * renderer);
 static int GDI_RenderPoint(SDL_Renderer * renderer, int x, int y);
 static int GDI_RenderLine(SDL_Renderer * renderer, int x1, int y1, int x2,
                           int y2);
@@ -175,6 +176,7 @@
     renderer->UpdateTexture = GDI_UpdateTexture;
     renderer->LockTexture = GDI_LockTexture;
     renderer->UnlockTexture = GDI_UnlockTexture;
+    renderer->SetDrawBlendMode = GDI_SetDrawBlendMode;
     renderer->RenderPoint = GDI_RenderPoint;
     renderer->RenderLine = GDI_RenderLine;
     renderer->RenderFill = GDI_RenderFill;
@@ -574,6 +576,19 @@
 }
 
 static int
+GDI_SetDrawBlendMode(SDL_Renderer * renderer)
+{
+    switch (renderer->blendMode) {
+    case SDL_BLENDMODE_NONE:
+        return 0;
+    default:
+        SDL_Unsupported();
+        renderer->blendMode = SDL_BLENDMODE_NONE;
+        return -1;
+    }
+}
+
+static int
 GDI_RenderPoint(SDL_Renderer * renderer, int x, int y)
 {
     GDI_RenderData *data = (GDI_RenderData *) renderer->driverdata;