src/render/SDL_render.c
changeset 6578 77d70ec131bc
parent 6546 824535ce51b6
child 6579 2390a7403b77
--- a/src/render/SDL_render.c	Thu Oct 11 15:05:00 2012 -0700
+++ b/src/render/SDL_render.c	Fri Oct 12 02:20:10 2012 -0700
@@ -952,6 +952,12 @@
     return 0;
 }
 
+SDL_Texture *
+SDL_GetRenderTarget(SDL_Renderer *renderer)
+{
+    return renderer->target;
+}
+
 static int
 UpdateLogicalSize(SDL_Renderer *renderer)
 {
@@ -961,7 +967,9 @@
     float scale;
     SDL_Rect viewport;
 
-    if (renderer->window) {
+    if (renderer->target) {
+        SDL_QueryTexture(renderer->target, NULL, NULL, &w, &h);
+    } else if (renderer->window) {
         SDL_GetWindowSize(renderer->window, &w, &h);
     } else {
         /* FIXME */