[…]
That’s what I have in mind too. Making OpenGL a backend (or target)
just like X11, svgalib or fbcon.
Well SDL itself chooses between those backends. The OpenGL 'backend’
should be
somthing that the programmer will choose.
Yes - but it has to be possible to force unknowing applications to use it
as well. That’s actually one of the very points with making it a backend,
as applications that explicitly ask for OpenGL would perhaps be better
off using OpenGL directly.
Ok, it is easier to add an option and a flag than adding native OpenGL
rendering support to a game, but SDL-on-OpenGL won’t give you anything
but speed! No new blending effects, no transformations, no antialiasing,
no sub-pixel accuracy… Nothing but very fast opaque, colorkey and
alpha blits. (Probably sufficient motivation in itself, but anyway…)
Why? Well SDL can’t know
beforehand
whether you are doing 2d blits along with actual pixel access or just
2d blits.
The former would be a lot faster in X11, DX, etc., the latter would be
much better
off in OpenGL.
Right. (Under OpenGL, “pixel effects” should be done through alpha
blended procedural textures instead.)
So I think the current SDL_SetVideoMode( width, height,
bpp, SDL_OPENGL | moreflags ) interface should remain intact.
Yes. (glSDL uses a flag SDL_GLSDL to actually engage the OpenGL code.)
So when an OpenGL display mode gets initialized, all SDL hardware
surfaces
should be created as 2D textures and blits would be done with
textured quads. Software surfaces should stay in system memory and
be copyed into textures when blitting.
Exactly. You could also take advantage of accelerated alpha-blending,
or apply anti-aliasing to the final rendered image. Needless to say
how fast it will be with a good video card.
Yes, this is what I am doing in one of my unfinished games. I get over
700 fps
on my system with lots of sprites with alpha blending and rotation and
everything.
If this idea makes it into SDL 1.3, I can’t imagine how awesome it
would be.
It would be cool indeed - but it requires quite a few API changes, most
of which will only work with OpenGL or DirectX - or dog slow software
emulation…
If you want that kind of stuff, use OpenGL directly. It’s easier, faster
and doesn’t bloat the SDL API.
[…]
But Sam Lantinga, the author of SDL, hangs around this mailinglist as
well, so he’s bound to join the discussion sometime.
Actually, it would be kind of nice to get an official comment on this. Of
course, I might have missed something - but I still don’t know whether
I’m just wasting my time, or not…
//David Olofson — Programmer, Reologica Instruments AB
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |
-------------------------------------> http://olofson.net -'On Wednesday 20 February 2002 15:16, Dirk Gerrits wrote: