[SDL] SDL 1.3 and rendering API state management

Bob Pendleton bob at pendleton.com
Tue Sep 5 08:31:44 PDT 2006


On Tue, 2006-09-05 at 17:14 +0200, David Olofson wrote:
> On Tuesday 05 September 2006 16:46, Bob Pendleton wrote:
> [...]
> > > The problem is that the SDL_TextureID returned from 
> > > SDL_CreateTextureFromSurface() is just an internal identifier, and 
> > > there is no API to get an OpenGL texture name or a Direct3D
> > > texture interface object pointer from that.
> > 
> > That sounds like a minor API bug. You just need an API to let you
> > get at the texture id that SDL has hidden away somewhere else. Just
> > like the window id hack that is used to get Windows window ids for
> > people who want to tweak them directly.
> > 
> > That is easy enough to add and does not add complexity to the over
> > all design.
> 
> Yeah, that's what I'm thinking. There is a minor issue though; OpenGL 
> uses an integer ID, whereas Direct3D uses a pointer to a texture 
> interface object. I suppose one could typedef something that will 
> work for both, on a platform by platform basis.

I wouldn't even bother with a typedef. Just have one function for OpenGL
and one for Direct3D. If there are others then add specific functions
for them. This is not cross platform functionality and it should not
look like cross platform functionality.

		Bob Pendleton

> 
> 
> //David Olofson - Programmer, Composer, Open Source Advocate
> 
> .-------  http://olofson.net - Games, SDL examples  -------.
> |        http://zeespace.net - 2.5D rendering engine       |
> |       http://audiality.org - Music/audio engine          |
> |     http://eel.olofson.net - Real time scripting         |
> '--  http://www.reologica.se - Rheology instrumentation  --'
> 
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
> 
-- 
+--------------------------------------+
+ Bob Pendleton: writer and programmer +
+ email: Bob at Pendleton.com             +
+ web: www.GameProgrammer.com          +
+ www.Wise2Food.com                    +
+ nutrient info on 7,000+ common foods +
+--------------------------------------+






More information about the SDL mailing list