Render to Texture

Hi,

I’m making a retro-style game that is rendered at a lower resolution, and then scaled back to the native screen size.
Also, the hud uses the native screen size.

In old style 1.2 suface api, it is easily done by rendering the game stuff to another surface, then bliting it to screen surface using SDL_SoftStrech, then I blit the hud to screen…

But I can’t find a way to do this using the new Rendering API, I was wondering if I can create a Renderer that renders to a Texture instead of a window.

Thanks

I submitted a render target API patch and an implementation for OpenGL quite a while ago, and a few people have contributed to it, adding implementations for other renderers, but it’s never quite made it into the codebase.? Check out http://bugzilla.libsdl.org/show_bug.cgi?id=983, but be aware that this is still an unofficial patch.

Mason________________________________
From: cuecax@gmail.com (Rodrigo C. Rocha)
Subject: [SDL] Render to Texture

Hi,

I’m making a retro-style game that is rendered at a lower resolution, and then scaled back to the native screen size.
Also, the hud uses the native screen size.

In old style 1.2 suface api, it is easily done by rendering the game stuff to another surface, then bliting it to screen surface using SDL_SoftStrech, then I blit the hud to screen…

But I can’t find a way to do this using the new Rendering API, I was wondering if I can create a Renderer that renders to a Texture instead of a window.

Thanks


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

On Dom 09 Oct 2011 16:57:10 RodrigoCard escribi?:

Hi,

I’m making a retro-style game that is rendered at a lower resolution, and
then scaled back to the native screen size. Also, the hud uses the native
screen size.

In old style 1.2 suface api, it is easily done by rendering the game stuff
to another surface, then bliting it to screen surface using
SDL_SoftStrech, then I blit the hud to screen…

But I can’t find a way to do this using the new Rendering API, I was
wondering if I can create a Renderer that renders to a Texture instead of
a window.

Thanks

I’ve fixed up Mason’s patch for Render to Texture targets so it should apply
cleanly on the official 1.3, you can either apply it yourself from bug 983 or
you can check out from my bitbucket: https://bitbucket.org/gabomdq/sdl-1.3-
experimental (Texture rendering works for Direct3D, OpenGL, ES 1 and 2 but not
for software rendering or other backends).

Gabriel.