[SDL] Feature Query System (Was: Some multithreaded improvement to the event queue...)
bob at pendleton.com
Thu Sep 29 09:02:57 PDT 2005
On Tue, 2005-09-27 at 23:42 -0400, Antonio SJ Musumeci wrote:
> Or maybe we wish to get the most out of the system without doing
> platform specific or bootleg things which need not be so. It seems to me
> that it is a "personal issue" to assume that everyone wishes to use a
> given library the same way you do. Just because you have no use or see
> the need does not mean others don't. Not everyone believes black box
> magic is the best solution. And not all of SDL is written that way. If a
> library is not going to offer consistent operation across platforms...
> there must be a way to accommodate. SDL does not offer accommodations in
> all cases and therefore deficient. And not offering the ability to see
> which choices are were made within the library and change them is simply
> laziness. Not having a way to query SDL_WM_ToggleFullScreen to see if
> it's supported... knowing it's not on all but a few platforms is laziness.
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 fail to see how making this personal and placing it in the realm of a
> flame war is constructive.
It isn't constructive. But, it happens that some peoples personalities
go against the philosophy upon which some software is based. That is
just the way the universe is.
Rather than continue a discussion that is devolving into a flame pit why
don't we try something more constructive. How about someone proposing
what the API would look like and what kind of queries they would like to
make? Then we can at least talk about something meaningful and
So, I expect that all SDL queries could be handled by something such as
(and excuse my lack of precision on data types, this is just an
int SDL_Query(enum SDL_FeatureName, void *extra)
The enum type would list all the queryable features of SDL. The function
would return true or false to tell you if the feature was available or
not. If the "extra" pointer is non-NULL then it is assumed to point to a
structure of the correct type to hold any extra information that you
would expect to get back from the query. Feel free to tell me how messed
up this is, but only if you offer and alternative.
So what features do you want to query, and how would you implement the
query on every platform that SDL supports?
> Ryan C. Gordon wrote:
> >>And sometimes I simply don't want my
> >>game to run in a "zoomed out" mode as is SDLs basic behaviour given a
> >>non-existent resolution
> > Then perhaps you should use SDL_ListModes() with the SDL_FULLSCREEN flag
> > to figure out if the resolution you want is available?
> > I couldn't help but notice that everyone really begging for a
> > generalized capabilities system has referred to themselves as a "control
> > freak" or something similar. In those cases, I would suggest that this
> > is a personal issue and not an API deficiency.
> > --ryan.
> > _______________________________________________
> > SDL mailing list
> > SDL at libsdl.org
> > http://www.libsdl.org/mailman/listinfo/sdl
> SDL mailing list
> SDL at libsdl.org
+ 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