[SDL] Using OpenGL for image transformations
Alberto Luaces
aluaces at udc.es
Wed Sep 17 07:29:56 PDT 2008
Hi,
El Miércoles 17 Septiembre 2008ES 15:50:36 Scott Harper escribió:
> Also (and here's something I haven't done, actually) in OpenGL there's
> a way to take a frame buffer and turn that directly into a new
> texture. In this case, you could (once) draw the newly configured
> sprite as you describe into an offscreen frame buffer object, then
> read that back in as a new texture, and finally draw the new texture
> as a larger quad within the main view.
I submitted a link to a FBO tutorial on my first reply :) However I think a
tile engine isn't worth it, since on current cards the bottleneck is usually
on the fill rate and not the vertex processing. Why bother obfuscating the
code with several layers of intermediate surfaces when you can place a great
number of tiles almost for free? If you are after a tile engine, you can even
make a static grid that covers the whole screen and only change texture
coordinates from frame to frame. No translations or rotations of geometry
involved ;)
For the general blitter case I suggest looking at SDL 1.3 source, since a
general GL blitter backend is being developed.
Alberto
More information about the SDL
mailing list