[SDL] Feature Query System (Was: Some multithreaded improvement to the event queue...)

Bob Pendleton bob at pendleton.com
Fri Sep 30 08:19:28 PDT 2005


On Thu, 2005-09-29 at 18:20 +0100, Tom Wilson wrote:
> >Funny thing is that SDL_WM_ToggleFullScreen is the prime example used to
> >justify the need of a query system in SDL. The thing is, it is
> >documented that it only works on one kind of system, so a simple #ifdef
> >(or the equivalent) is all that your code needs to determine if you have
> >the feature or not. Having said that, I also want to say that
> >SDL_WM_ToggleFullScreen is one of a very few features that are only
> >supported on a single platform. I, personally, would have objected to
> >adding a feature that can only be supported on a single platform. I,
> >personally, would rather see SDL_WM_ToggleFullScreen removed from SDL
> >than see a large complex query system added to SDL.
> >  
> >
> 
> I only just noticed this thread, but it occurred to me that if you query 
> a load of functions and they are not available, then the code you would 
> have to write in order to dodge around the missing functions would be a 
> total nightmare.  

Yep, that has been mentioned earlier in the thread. Anyone who has
worked with systems with a large query facility has learned that you
really don't gain anything of value from using it. If you gain anything
at all you gain the ability to refuse to run a few microseconds faster
than if you just try to run and have some function fail.

> Maybe we also need a library for that, which 
> auto-queries SDL and returns a struct full of function pointers....  Or 
> we could just not waste our time.

Yep, the solution to one "problem" leads to a cascade of other problems.
Solving those "problems" leads to adding tons of complication to the
library and to applications and then find that almost no one cares uses
them.

> 
> Like Bob says I think you are just better off doing some macro stuff, 
> rather than over complicating matters.
> 
> #ifdef _PLATFORM_IS_FOO
>     SDL_WM_ToggleFullScreen();
> #else
>     //do something else.
> #endif
> 
> For people using a python or some other scripting language this not an 
> option, but i'm sure there is a function in Python that gets the OS
> 
> Infact I just looked it up you can use platform.system();
> 
> /import platform//
> platform.system()/
> 
> 
> - Tom
> 
> 
	thank you,

		Bob Pendleton
> 
> 
> 
> 
> _______________________________________________
> 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