diff src/render/SDL_render.c @ 5169:4d39eeaad00b

Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface. The software renderer has been re-routed to use the framebuffer interface, which makes it possible to have software rendering available even on simple ports.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 03 Feb 2011 15:49:37 -0800
parents b3ccd1947786
children 4d098d286794
line wrap: on
line diff
--- a/src/render/SDL_render.c	Thu Feb 03 11:16:57 2011 -0800
+++ b/src/render/SDL_render.c	Thu Feb 03 15:49:37 2011 -0800
@@ -26,6 +26,7 @@
 #include "SDL_render.h"
 #include "SDL_sysrender.h"
 #include "../video/SDL_pixels_c.h"
+#include "software/SDL_renderer_sw_c.h"
 
 
 #define CHECK_RENDERER_MAGIC(renderer, retval) \
@@ -137,12 +138,19 @@
 
     if (renderer) {
         renderer->magic = &renderer_magic;
+        renderer->window = window;
 
         SDL_AddEventWatch(SDL_RendererEventWatch, renderer);
     }
     return renderer;
 }
 
+SDL_Renderer *
+SDL_CreateSoftwareRenderer(SDL_Surface * surface)
+{
+    return SW_CreateRendererForSurface(surface);
+}
+
 int
 SDL_GetRendererInfo(SDL_Renderer * renderer, SDL_RendererInfo * info)
 {