[SDL] SDL Joystick troubles

Mark Jenison jenison at enteract.com
Wed Sep 27 18:47:54 PDT 2006

On Mon, 2006-09-04 at 22:58 +0200, David Olofson wrote:
> On Monday 04 September 2006 20:03, Bob Pendleton wrote:
> [...]
> > Apologies for not editing this post down, but I wasn't sure what to
> > edit out :-) My suggestion is that the advanced SDL 2d/3d (what
> > ever) should just cause and error termination if they are called on
> > an OpenGL surface. There is *never any reason* to use them on an
> > OpenGL surface. 
> Well, as long as it's strictly forbidden to use them in GUI toolkits 
> and other add-on libs. And "basic" SDL 2D is out too, so basically, 
> if you use OpenGL (or Direct3D), you're on your own - no SDL add-on 
> libs will be able to render over your display, unless they happen to 
> natively support your 3D API(s) of choice.

OK, here I see we have two very different ways of looking at things.
Remember that I have spent several full time months each of the last 2
years working on adding multiple windows to SDL. I got it working the
way I want it on X11. Right now I am just sitting here biting my tongue
hoping SDL 1.3 will not undo all the work I have done.

The right way to do GUI tool kits is to have multiple windows and
windows within windows. The way I implemented it some windows can be
normal SDL 2D windows and some can be 3D OpenGL windows with each OpenGL
window having its own context. This way you can have any mixture of 2D
and 3D on the screen that you want. You can have 3D pop ups over 2D and
2D pop ups over 3D. You can have a 3D window as part of your screen with
a nice tree widget in a 2D window next to the 3D window. 

I think that solves the problem you are talking about here. Also, it
makes it possible to build powerful GUI toolkits without putting one
into SDL. And, better yet, I have permission to add this to SDL after
1.3 is released.

		Bob Pendleton

> I believe it's easier and safer to wire existing libs to a custom 
> implementation of the SDL 2D, Advanced2D and/or whatever API, than to 
> port the libs. Also, if you decide to switch to alternative lib or 
> newer version or something down the road, your porting effort becomes 
> more or less wasted time, whereas if you had your own SDL *2D 
> implementation, you could just switch lib and get on with the real 
> work.
> > OTOH No reason they can't work on software surfaces. But, it is
> > clear that they will mess up the rendering context on an OpenGL
> > surface.
> They won't do anything beyond your control if their backends call into 
> your own rendering code. :-)
> > The alternative is to post a context lost event (which is 
> > something Windows users have wanted for a long time) and do what
> > ever they do. But, that is asking for problems. Another alternative
> > behavior is to error off unless the programmer has asked for context
> > lost events. Then you know the programmer is ready to handle the
> > context problems caused by using the SDL APIs when they really
> > should not use them.
> Yeah, I like the general idea of somehow making it hard for developers 
> to not realize there is a problem to deal with.
> The context lost event is effectively the notification system I had in 
> mind, only much simpler and probably quite sufficient to deal with 
> the problem.
> Not sure what happens if you have more than two clients - the (SDL 
> core or other) renderer and the application - but OTOH, you should 
> never need that if things like Advanced2D can implement both the SDL 
> 2D API and it's own extensions in the same renderer. (Well, maybe if 
> we end up with more than one rendering extension lib and people want 
> to mix libs that don't use the same rendering extension lib, but the 
> idea with Advanced2D is that it should cover pretty much anything 
> that isn't best done with the normal SDL 2D API or directly over a 3D 
> API. :-)
> //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