Hi all !
Is there any tutorial, demo, game, … where i can look for some
code to do some
sprite animation with SDL and openGL. Now i have a demo using SDL
and sprites
but i would like to test my platform converting this demo to use
the 3D capabilities
the same.
You most probably will get faster rendering with OpenGL, even if
you’re using a fully accelerated 2D backend now. (Don’t ask me why…
Probably something to do with 2D acceleration being out of fashion or
something.)
More importantly, perhaps; you’ll also get loads of new rendering/fx
possibilities, and pretty much all of it will be fully accelerated
wherever there is accelerated OpenGL at all. (As opposed to SDL 2D
alpha blending, which is only h/w accelerated by two or three
backends, including glSDL.)
Maybe glSDL ?
Well, that’s certainly the easiest solution, since you don’t really
have to do anything with your code to use it. It’s still the SDL 2D
API; just a different backend. (Or compile time wrapper, in the case
of the currently available versions.)
That’s also the flip side; it’s still the SDL 2D API. That is, the
only blending mode available is alpha (no additive blending, no color
modulation or anything like that), and there are no transformations
(scaling, rotation, skewing, perspective, …) or other “effects”,
beyond what you can do with the plain SDL 2D API.
If you want to go for the Real Thing (native OpenGL), all I have to
offer in the way of examples would be the smoothscroll example.
That’s really about sub-pixel accurate rendering for ultra smooth
scrolling, but adding sprites should be trivial. Just copy the tile
rendering code and add support for surfaces with alpha channel.
http://olofson.net/examples.html (smoothscroll)
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
— http://olofson.net — http://www.reologica.se —On Friday 26 March 2004 15.51, jorgefm at cirsa.com wrote:
from my openGL card to know if i can get more rendering speed to do