On Friday 07 January 2005 08.48, Evadream wrote:
[...]
> Until now, i blit between hardware surface and "active frame
> buffer" (set via SDL_SetVideoMode) very fast thanx to glSDL
> backend, so i wonder if it is possible to beneficiate of this
> acceleration with two hardware surface create via SDL_CreateRGB and
> blit between them. I've made some tests, and it doesn't look to
> work. Is this the normal behaviour ? Or i miss someting ?
This is a limitation of OpenGL. You can't perform accelerated
operations between textures - at least not without relying on
extensions that are available only on some platform/driver/hardware
combinations.
We'll try to make the best use of whatever is available in future
versions, but we'll have to make it work correctly and reliably
everywhere, before we move on to optimizations, and driver/hardware
specific optimizations in particular.
Blitting to the screen is what glSDL focuses on at this point, since
it's the only part of real time rendering that you can't avoid no
matter what. Off-screen rendering - if you have any at all - can
usually be done in advance, when installing the game, or when loading
levels.
Even games that use vector objects, pixel effects, complex compound
sprites and the like can sometimes make good use of glSDL, since
rendering into glSDL "h/w" surfaces (actually s/w shadow surfaces
since OpenGL cannot give you access to texture RAM) is very fast, and
uploading textures to the video card and then rendering with OpenGL
isn't much slower than rendering directly into VRAM. Actually, if the
OpenGL driver uses DMA for uploading, it's about the fastest path
there is from the CPU to VRAM - and either way, alpha blending with
glSDL comes at very little, if any, extra cost.
//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 ---