Some multithreaded improvement to the event queue

You do not need to understand the reason someone would want to use the
library in that way… but in my opinion not forbid them to do so. I see
no good reason to hide things from the developer. If the library chooses
between several methods to do something… I aught to be able to find
out which it chose and if i want override it. If he wants to shoot
himself in the foot I would gladly give him the gun and bullet. Steven
Johnson was correct… it’s a difference in philosophy. I am an embedded
developer. When I develop libraries which have any flexibility built in
I provide querys to find out as much info about how the library is
working as possible… as well as hooks to allow the user to override
anything which doesnt break the core design. I’ve run into way too many
situations where i hack around something or had to redesign something
because an underlying library hid functionality or didnt provide a
robust enough interface. If SDL checks for certain CPU extensions to
decide which memcpy would be the best… it can easily give me the
knowledge as to which it chose and the ability to override or replace.

Stephane wrote:> Antonio SJ Musumeci wrote:

the SDL_Surface flags dont give you the full story. Just because you
dont get a HW surface if you ask for one doesnt mean the platform or
driver doesnt support it. Or finding out which blitter is being used
on a specific platform would be nice… anything SDL hides doesnt need
to be completely hidden. You only lose flexability and limit the
developer. On a x86 machine I want to know if a MMX or SSE accerated
functions are being used or if I run in fullscreen i MAY be able to
get a hardware surface.

Think about it for a second. Why do you need that ? If all you want to
know is whether the platform is fast enough for your stuff, benchmark
it. That’s the only way. MMX on a 166Mhz CPU is going to be slower that
plain C on a 3Ghz one. Also, MMX is intel-specific, so looking at this
flag will make it look like that G5 is slow.

To prove my point I’ll cite the similar example of an old OpenGL
application that runs on windows. That application used the
windows-specific bits to query whether hardware acceleration was used,
and refused to run if it wasn’t. That was back in the days when a 200Mhz
CPU was fast. Nowadays this application could very well run on a 3Ghz
machine using software emulation, but the author was stupid enough to
prevent it.

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

May I hazard that the lack of a robust query / control system is a
prime reason for AAA titles not using SDL on the PC platform? I mean
SDL is a lot easier to code than DirectX, so why wouldn’t developers
use it?

/OlofOn 9/21/05, Antonio SJ Musumeci wrote:

You give up control but that does not mean that the library can’t offer
the developer control over it’s actions. SDL has several layers which
could allow the user to override functionally at runtime… but simply
does not provide the mechanism to do so. As for “try and see”… if a
query system existed to begin with and a platform did not support
probing… try and see can be used to simulate probing. Save state, try
and see, restore state. Anything which isnt consistent document and
offer the ability to query the feature. The whole
SDL_WM_ToggleFullScreen in Linux vs everywhere else thing. Instead of
just having it fail (which tells you practically nothing) when not
supported… offer the ability to find out. You may not want to try
it… but simply offer the ability later on or not depending of it’s
availability. Similarly with drivers… you currently cant just offer
the user a choice of drivers to pick from… nor can you simply add your
own at run time.

Steven Johnson wrote:

This sounds like a conflict between embedded development mind sets
and PC development mind sets.

I think the problem is that with a library like SDL, a certain
measure of control (in the nature of what you discuss) is lost. This
is because it is an abstraction library, which hides the details of
the underlying mechanisms. By using the library you are “giving up
control” to the library. If you want to have “total control” you
need to do things directly (ie, with the hardware, or with target
specific libraries), and not worry about a library that attempts to
have your code write once, compile everywhere, Where each and every
target will have different control issues, that the library has been
designed to hide.

This problem sounds more like a conflict of philosophy. I can see
nothing wrong with a “try and see” approach. This is ultimately what
you do when you probe hardware anyway. The difference here is that
the activating of the code, and the probing of its
functionality/existence, is combined into a single operation.

My 2c. Steven


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I’m not sure I understand. Writing software is all about control. Unless
the hardware itself has no way of being polled or a query system
faked… one can always dig deeper through the abstractions to gain the
information they seek… or replace those abstractions with something
that would give them the desired info.

Yeah, I was pretty cryptic in my last message, sorry about that.

Let me try to explain a little more. The truth is that software
development is not about control. It is about writing code that works
properly even when you have no control over the hardware. Or, at least
that is what writing commercial software is about. You can specify that
the software should be run on hardware with certain abilities, but you
can’t keep people from running it on inappropriate hardware. And, that
goes both ways. No matter what kind of hardware you develop on,
eventually your code will be run on hardware that is much more powerful.
Writing software that works properly on more advanced hardware is not as
easy as it sounds. We all make assumptions that we are not aware of.

Then there is the simple problem of what to do with all that
information. So you can query a million little details, so what? Inside
your program how much information can you use? How many different paths
do you want to code so that you can adapt to the current machine? If it
doesn’t support alpha blending and your program uses alpha blending are
you going to be able to write a path through your code that allows the
program to be used with out alpha blending? That is a lot of extra code
and a lot of extra time. Same thing goes for a Z buffer. If your code
assumes it, and you don’t have one, there is little you can do about it.
What is the point of querying for those buffers? Just try to initialize
asking for alpha and Z and when it fails you know all you need to know.

Most of the time you can get all the information you need from trying to
set up the hardware the way you want it and looking at the results you
get back. After that, simply monitor the frames per second and quit if
it is to low to be useful.

	Bob PendletonOn Tue, 2005-09-20 at 15:41 -0400, Antonio SJ Musumeci wrote:

Bob Pendleton wrote:

On Fri, 2005-09-16 at 19:43 -0400, Antonio SJ Musumeci wrote:

I understand that completely… however “try and see” feels really dirty
to me. Nor does it give reasons as to why something doesnt work. I’m a
control freak… i want to know everything thats going on.

Eventually you will learn that you have no control and get on with
writing your programs. Took me decades to get there, but I am much
happier now.

  Bob Pendleton

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

You do not need to understand the reason someone would want to use the
library in that way… but in my opinion not forbid them to do so. I see
no good reason to hide things from the developer. If the library chooses
between several methods to do something… I aught to be able to find
out which it chose and if i want override it. If he wants to shoot
himself in the foot I would gladly give him the gun and bullet. Steven
Johnson was correct… it’s a difference in philosophy. I am an embedded
developer.

Interesting. I suppose this is a philosophical difference. You see, the
whole reason for having a library like SDL, in fact, the only reason
for having a library like SDL, is to hide all these decisions so that
the developer can get on with writing his applications without having to
worry about how things actually get done. Without that philosophy SDL
could not be machine and OS independent.

When I develop libraries which have any flexibility built in
I provide querys to find out as much info about how the library is
working as possible… as well as hooks to allow the user to override
anything which doesnt break the core design. I’ve run into way too many
situations where i hack around something or had to redesign something
because an underlying library hid functionality or didnt provide a
robust enough interface. If SDL checks for certain CPU extensions to
decide which memcpy would be the best… it can easily give me the
knowledge as to which it chose and the ability to override or replace.

I suppose that might make sense for the kind of embedded programming you
do. It doesn’t make much sense to me.

	Bob PendletonOn Tue, 2005-09-20 at 19:52 -0400, Antonio SJ Musumeci wrote:

Stephane wrote:

Antonio SJ Musumeci wrote:

the SDL_Surface flags dont give you the full story. Just because you
dont get a HW surface if you ask for one doesnt mean the platform or
driver doesnt support it. Or finding out which blitter is being used
on a specific platform would be nice… anything SDL hides doesnt need
to be completely hidden. You only lose flexability and limit the
developer. On a x86 machine I want to know if a MMX or SSE accerated
functions are being used or if I run in fullscreen i MAY be able to
get a hardware surface.

Think about it for a second. Why do you need that ? If all you want to
know is whether the platform is fast enough for your stuff, benchmark
it. That’s the only way. MMX on a 166Mhz CPU is going to be slower that
plain C on a 3Ghz one. Also, MMX is intel-specific, so looking at this
flag will make it look like that G5 is slow.

To prove my point I’ll cite the similar example of an old OpenGL
application that runs on windows. That application used the
windows-specific bits to query whether hardware acceleration was used,
and refused to run if it wasn’t. That was back in the days when a 200Mhz
CPU was fast. Nowadays this application could very well run on a 3Ghz
machine using software emulation, but the author was stupid enough to
prevent it.

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

May I hazard that the lack of a robust query / control system is a
prime reason for AAA titles not using SDL on the PC platform? I mean
SDL is a lot easier to code than DirectX, so why wouldn’t developers
use it?

/Olof

Do you have any evidence to back that up?

There are lots of reasons not to use SDL. The lack of a query system
isn’t something I have ever heard mentioned. Poor support for random
Joysticks and the latest sound hardware along with poor vendor (MS)
support for OpenGL are reasons I have heard.

	Bob PendletonOn Wed, 2005-09-21 at 08:39 +0200, Olof Bjarnason wrote:

On 9/21/05, Antonio SJ Musumeci wrote:

You give up control but that does not mean that the library can’t offer
the developer control over it’s actions. SDL has several layers which
could allow the user to override functionally at runtime… but simply
does not provide the mechanism to do so. As for “try and see”… if a
query system existed to begin with and a platform did not support
probing… try and see can be used to simulate probing. Save state, try
and see, restore state. Anything which isnt consistent document and
offer the ability to query the feature. The whole
SDL_WM_ToggleFullScreen in Linux vs everywhere else thing. Instead of
just having it fail (which tells you practically nothing) when not
supported… offer the ability to find out. You may not want to try
it… but simply offer the ability later on or not depending of it’s
availability. Similarly with drivers… you currently cant just offer
the user a choice of drivers to pick from… nor can you simply add your
own at run time.

Steven Johnson wrote:

This sounds like a conflict between embedded development mind sets
and PC development mind sets.

I think the problem is that with a library like SDL, a certain
measure of control (in the nature of what you discuss) is lost. This
is because it is an abstraction library, which hides the details of
the underlying mechanisms. By using the library you are “giving up
control” to the library. If you want to have “total control” you
need to do things directly (ie, with the hardware, or with target
specific libraries), and not worry about a library that attempts to
have your code write once, compile everywhere, Where each and every
target will have different control issues, that the library has been
designed to hide.

This problem sounds more like a conflict of philosophy. I can see
nothing wrong with a “try and see” approach. This is ultimately what
you do when you probe hardware anyway. The difference here is that
the activating of the code, and the probing of its
functionality/existence, is combined into a single operation.

My 2c. Steven


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

I think he was asking not stating. Either way I would agree with Bob. I
prefer a query system… but with SDL i code around it, hard code things
per platform, or simulate querying with try and see.

Bob Pendleton wrote:> On Wed, 2005-09-21 at 08:39 +0200, Olof Bjarnason wrote:

May I hazard that the lack of a robust query / control system is a
prime reason for AAA titles not using SDL on the PC platform? I mean
SDL is a lot easier to code than DirectX, so why wouldn’t developers
use it?

/Olof

Do you have any evidence to back that up?

There are lots of reasons not to use SDL. The lack of a query system
isn’t something I have ever heard mentioned. Poor support for random
Joysticks and the latest sound hardware along with poor vendor (MS)
support for OpenGL are reasons I have heard.

  Bob Pendleton

On 9/21/05, Antonio SJ Musumeci <@Antonio_Musumeci> wrote:

You give up control but that does not mean that the library can’t offer
the developer control over it’s actions. SDL has several layers which
could allow the user to override functionally at runtime… but simply
does not provide the mechanism to do so. As for “try and see”… if a
query system existed to begin with and a platform did not support
probing… try and see can be used to simulate probing. Save state, try
and see, restore state. Anything which isnt consistent document and
offer the ability to query the feature. The whole
SDL_WM_ToggleFullScreen in Linux vs everywhere else thing. Instead of
just having it fail (which tells you practically nothing) when not
supported… offer the ability to find out. You may not want to try
it… but simply offer the ability later on or not depending of it’s
availability. Similarly with drivers… you currently cant just offer
the user a choice of drivers to pick from… nor can you simply add your
own at run time.

Steven Johnson wrote:

This sounds like a conflict between embedded development mind sets
and PC development mind sets.

I think the problem is that with a library like SDL, a certain
measure of control (in the nature of what you discuss) is lost. This
is because it is an abstraction library, which hides the details of
the underlying mechanisms. By using the library you are “giving up
control” to the library. If you want to have “total control” you
need to do things directly (ie, with the hardware, or with target
specific libraries), and not worry about a library that attempts to
have your code write once, compile everywhere, Where each and every
target will have different control issues, that the library has been
designed to hide.

This problem sounds more like a conflict of philosophy. I can see
nothing wrong with a “try and see” approach. This is ultimately what
you do when you probe hardware anyway. The difference here is that
the activating of the code, and the probing of its
functionality/existence, is combined into a single operation.

My 2c. Steven


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

The whole point of the queryable system is to accomidate for the system
you are on at runtime. No software but that which is run on embedded or
very specific systems should assume much of anything IMO. Videogames
from the beginning have offered different capabilities based on what was
physically possible on the machine or could be emulated. And they
allowed the player to choose which to enable. OpenGL games do this all
the time. Just because something exists doesnt mean you want or dont
want to use it.

It’s not a matter of millions of little details and whether I will use
them. It’s whether I want to use them. Maybe I want my game to run with
no alpha blending if the host system doesnt support it or the user
doesnt want it… even if that means having a completely seperate code
base. The library designer doesnt need to know or care. It’s about
control. If the user wants to use my app on an old machine and emulate
features and only get .5FPS… i dont care… but i’m not going to force
him to. Nor should the base libraries force me.

Like i said before… a simple failure to activate does not give you the
full picture nor do you always want to perform the act to get the info.
SDL_WM_ToggleFullScreen is a good example of the point i’m trying to
make. Maybe I dont want to toggle the screen. I just want to be able to
provide the option to do so… but only if supported. AFAIK the only way
to do that currently is to try and toggle… if it works toggle back
then you know you can do it. Not clean at all. Or if it fails… i see
no mechinism to say why it failed. Maybe the windowing system was busy
or locked it or it’s not supported or it’s whatever.

A runtime query system allows for aplications not to have to worry about
which platform they are compiled on. I shouldn’t need #ifdef WIN32 when
using a crossplatform library unless i’m using something outside it’s
scope. I fail to see how offering more flexability and power to the
library user is a bad thing. A few get/set’ers and sprucing up of the
API could allow for fun things like runtime driver addition which would
make things like glSDL easier to test. A timer resolution query would
allow people to get rid of those cludgy (though simple) functions to do
the same by busy looping. In the least a platform could fall back to a
save state, try and see, restore state query fake out to find out what
it supports.

-antonio

Bob Pendleton wrote:> Yeah, I was pretty cryptic in my last message, sorry about that.

Let me try to explain a little more. The truth is that software
development is not about control. It is about writing code that works
properly even when you have no control over the hardware. Or, at least
that is what writing commercial software is about. You can specify that
the software should be run on hardware with certain abilities, but you
can’t keep people from running it on inappropriate hardware. And, that
goes both ways. No matter what kind of hardware you develop on,
eventually your code will be run on hardware that is much more powerful.
Writing software that works properly on more advanced hardware is not as
easy as it sounds. We all make assumptions that we are not aware of.

Then there is the simple problem of what to do with all that
information. So you can query a million little details, so what? Inside
your program how much information can you use? How many different paths
do you want to code so that you can adapt to the current machine? If it
doesn’t support alpha blending and your program uses alpha blending are
you going to be able to write a path through your code that allows the
program to be used with out alpha blending? That is a lot of extra code
and a lot of extra time. Same thing goes for a Z buffer. If your code
assumes it, and you don’t have one, there is little you can do about it.
What is the point of querying for those buffers? Just try to initialize
asking for alpha and Z and when it fails you know all you need to know.

Most of the time you can get all the information you need from trying to
set up the hardware the way you want it and looking at the results you
get back. After that, simply monitor the frames per second and quit if
it is to low to be useful.

  Bob Pendleton

Bob Pendleton wrote:

On Fri, 2005-09-16 at 19:43 -0400, Antonio SJ Musumeci wrote:

I understand that completely… however “try and see” feels really dirty
to me. Nor does it give reasons as to why something doesnt work. I’m a
control freak… i want to know everything thats going on.

Eventually you will learn that you have no control and get on with
writing your programs. Took me decades to get there, but I am much
happier now.

  Bob Pendleton

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

You do not need to understand the reason someone would want to use the
library in that way… but in my opinion not forbid them to do so. I see
no good reason to hide things from the developer. If the library chooses
between several methods to do something… I aught to be able to find
out which it chose and if i want override it. If he wants to shoot
himself in the foot I would gladly give him the gun and bullet. Steven
Johnson was correct… it’s a difference in philosophy. I am an embedded
developer.

Interesting. I suppose this is a philosophical difference. You see, the
whole reason for having a library like SDL, in fact, the only reason
for having a library like SDL, is to hide all these decisions so that
the developer can get on with writing his applications without having to
worry about how things actually get done. Without that philosophy SDL
could not be machine and OS independent.

Well, I don’t see how a program doing queries to improve certain
features of runtime operation implies the program beeing less platform
independent …On 9/23/05, Bob Pendleton wrote:

On Tue, 2005-09-20 at 19:52 -0400, Antonio SJ Musumeci wrote:

When I develop libraries which have any flexibility built in
I provide querys to find out as much info about how the library is
working as possible… as well as hooks to allow the user to override
anything which doesnt break the core design. I’ve run into way too many
situations where i hack around something or had to redesign something
because an underlying library hid functionality or didnt provide a
robust enough interface. If SDL checks for certain CPU extensions to
decide which memcpy would be the best… it can easily give me the
knowledge as to which it chose and the ability to override or replace.

I suppose that might make sense for the kind of embedded programming you
do. It doesn’t make much sense to me.

           Bob Pendleton

Stephane wrote:

Antonio SJ Musumeci wrote:

the SDL_Surface flags dont give you the full story. Just because you
dont get a HW surface if you ask for one doesnt mean the platform or
driver doesnt support it. Or finding out which blitter is being used
on a specific platform would be nice… anything SDL hides doesnt need
to be completely hidden. You only lose flexability and limit the
developer. On a x86 machine I want to know if a MMX or SSE accerated
functions are being used or if I run in fullscreen i MAY be able to
get a hardware surface.

Think about it for a second. Why do you need that ? If all you want to
know is whether the platform is fast enough for your stuff, benchmark
it. That’s the only way. MMX on a 166Mhz CPU is going to be slower that
plain C on a 3Ghz one. Also, MMX is intel-specific, so looking at this
flag will make it look like that G5 is slow.

To prove my point I’ll cite the similar example of an old OpenGL
application that runs on windows. That application used the
windows-specific bits to query whether hardware acceleration was used,
and refused to run if it wasn’t. That was back in the days when a 200Mhz
CPU was fast. Nowadays this application could very well run on a 3Ghz
machine using software emulation, but the author was stupid enough to
prevent it.

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Sounds interesting, … tell me if you make any progress / drafts …
How platform independent are you thinking?On 9/23/05, Olof Bjarnason <@Olof_Bjarnason> wrote:

On 9/23/05, Bob Pendleton wrote:

On Tue, 2005-09-20 at 19:52 -0400, Antonio SJ Musumeci wrote:

You do not need to understand the reason someone would want to use the
library in that way… but in my opinion not forbid them to do so. I see
no good reason to hide things from the developer. If the library chooses
between several methods to do something… I aught to be able to find
out which it chose and if i want override it. If he wants to shoot
himself in the foot I would gladly give him the gun and bullet. Steven
Johnson was correct… it’s a difference in philosophy. I am an embedded
developer.

Interesting. I suppose this is a philosophical difference. You see, the
whole reason for having a library like SDL, in fact, the only reason
for having a library like SDL, is to hide all these decisions so that
the developer can get on with writing his applications without having to
worry about how things actually get done. Without that philosophy SDL
could not be machine and OS independent.

Well, I don’t see how a program doing queries to improve certain
features of runtime operation implies the program beeing less platform
independent …

When I develop libraries which have any flexibility built in
I provide querys to find out as much info about how the library is
working as possible… as well as hooks to allow the user to override
anything which doesnt break the core design. I’ve run into way too many
situations where i hack around something or had to redesign something
because an underlying library hid functionality or didnt provide a
robust enough interface. If SDL checks for certain CPU extensions to
decide which memcpy would be the best… it can easily give me the
knowledge as to which it chose and the ability to override or replace.

I suppose that might make sense for the kind of embedded programming you
do. It doesn’t make much sense to me.

           Bob Pendleton

Stephane wrote:

Antonio SJ Musumeci wrote:

the SDL_Surface flags dont give you the full story. Just because you
dont get a HW surface if you ask for one doesnt mean the platform or
driver doesnt support it. Or finding out which blitter is being used
on a specific platform would be nice… anything SDL hides doesnt need
to be completely hidden. You only lose flexability and limit the
developer. On a x86 machine I want to know if a MMX or SSE accerated
functions are being used or if I run in fullscreen i MAY be able to
get a hardware surface.

Think about it for a second. Why do you need that ? If all you want to
know is whether the platform is fast enough for your stuff, benchmark
it. That’s the only way. MMX on a 166Mhz CPU is going to be slower that
plain C on a 3Ghz one. Also, MMX is intel-specific, so looking at this
flag will make it look like that G5 is slow.

To prove my point I’ll cite the similar example of an old OpenGL
application that runs on windows. That application used the
windows-specific bits to query whether hardware acceleration was used,
and refused to run if it wasn’t. That was back in the days when a 200Mhz
CPU was fast. Nowadays this application could very well run on a 3Ghz
machine using software emulation, but the author was stupid enough to
prevent it.

Stephane


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

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.

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.

I fail to see how making this personal and placing it in the realm of a
flame war is constructive.

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

I don’t think Ryan’s intentions were to upset you, or anyone else, over
this matter. The beauty of OSS is that you can change, enhance, or just
generally recreate any piece of the package/library and offer it back to
the main development branch in the form of a patch. I know not everyone
has the time to give back every little thing they think up, but we have
to remember that the core SDL developers aren’t really any different
than us. There are two options that I can see to your problem:

  1. Create a configuration file and let the user set up the display
    options in the program or via an external program. This requires a fair
    amount of coding, but nothing so grave as to cause anyone grey hairs.
  2. Modify the main SDL library to be able to query for the specifics of
    switching between windowed or fullscreen. This requires knowledge of
    the codebase, submitting it to CVS, and awaiting for it to be verified
    as usable on more than just one platform.

Personally, I use the first method (as do most commercial games) and
feel it works quite well for what I need it to do. Not only are your
users able to have some more control over the display, but you have the
ability to reuse the code for selecting the modes in other
applications. I did see a project a little while back titled
SDL_config, and it may well serve your purpose without requiring
modifications to the core library, though I haven’t looked into it very
much.

I think the most important thing to remember is that we’re all working
toward the same goal: making a piece of software more usable, be it a
game, library, or something completely different.

-Elden

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.

I fail to see how making this personal and placing it in the realm of
a flame war is constructive.

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
http://www.libsdl.org/mailman/listinfo/sdl

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.

No, I recognize that there are uses of SDL beyond the ones that I have
immediate needs for, but I also have to exercise restraint on behalf of
the group: API architects, backend maintainers, end-user apps…and I
think that this specific API addition is not a good idea, after years of
working around unsupported GL extensions, and wondering what to do when
a given capability bit is missing in DirectX.

Not everyone believes black box magic is the best solution. And not all
of SDL is written that way.

SDL tries hard to hide all the nasty, and allows limited, specific
queries for the parts that tend to bite developers…In many ways, SDL
was sort of organically grown through what immediate needs Sam and Loki
had, and what they could cleanly codify into an API. This is a delicate
balancing act, and I recognize that not everyone is always happy with
the results all the time.

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.

I agree with you here, for what it’s worth, and as this is the example
that keeps coming up, perhaps we should focus on it?

How about a adding a read-only bit to SDL_Surface::flags…an
SDL_CANTOGGLEFULLSCREEN bit or something?

Generally, deprecating SDL_WM_ToggleFullScreen() might be a better idea,
since a responsible program should just call SDL_SetVideoMode() and
reset all the relevant state.

I fail to see how making this personal and placing it in the realm of a
flame war is constructive.

It’s not meant to be a flame, and I apologize if you took it as
one…Bob was much more eloquent than I was, but he’s saying the same
thing: a capabilities system really doesn’t gain you as much as you think.

–ryan.

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
measurable.

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
example…):

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?

	Bob PendletonOn Tue, 2005-09-27 at 23:42 -0400, Antonio SJ Musumeci wrote:

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
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

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. 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.

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

Most languages do not have preprocessors so I fail to see how just using
#ifdef’s is feasible. Plus, all those #def’s could more easily and
consistently be taken care of at compile time of SDL instead of the app
which would use SDL. It seems to me if you wish to make the user of SDL
more cross platform you’d try to hide as much platform specific things
as reasonably possible. SDL has the infrastructure already to figure out
what features and what OS it’s being built on… why not take advantage
of it. Instead of #ifdefs, one could simply have a SDL function saying
whether X is functional/supported and worry about specific
implementation later or simply ignore that functionality. Some things
are just a nicety… like togglefullscreen… and if i cant do it i dont
necessarily need to recreate it… just not offer it. and having
specific #ifdefs does not scale well. If all of a sudden I go and add
support for platform X to SDL and my SDL app doesnt get recompiled with
new #ifdefs… i cant use it. However something like:

SDL_bool
SDL_WM_ToggleFullscreenSupported(void)
{
#if defined X11 || BEOS || whatever
return SDL_TRUE;
#else
return SDL_FALSE;
#endif
}

this works and puts the responsibility on SDL.

In an extreme case, the fact you can remove whole subsystems of SDL from
the library is not accommodated for. I noticed that the WinCE code has 1
or 2 dummy subsystems. It’d be nice to include dummy subsystems for
everything within reason and allow runtime checking for functional
systems. Then you dont need specific platforms to have dummy code like
that. I dont see how all these things which are already known at compile
time causes a query system to be large and complex. Just place a few
#ifdefs in the drivers for things which arent consistent. Many things in
SDL have queryable options. I’d just like to see it used more.

I’d like to be able to find out which driver’s are compiled in instead
of including a list i grabbed off the wiki. I’d like to have a less
bootleg way of requesting a driver to be used. I’d like to see access
methods to parts of SDL that are currently hidden. If you put a few
functions in to allow getting a list of blitters available… a list of
function pointers and so you could benchmark them all and possibly add
your own at runtime. Or access to the function pointers which make up
the subsystem drivers so drivers could be designed and tested without
recompiling SDL. Loaded from a loadable module even. I’d have to look
more around the library since I don’t use it all to come up with more…
but those are pretty simple to add as far as I can tell… and add tons
of power and possibilities to SDL.

as for the SDL_Query idea. I dont know if a completely global query
system or subsystem specific would be better. global would be nice
however it could require some major changes to the build system to
create the database of queryable options. Adding functions per queryable
item which could be generated at compile time with
#ifdefs/configure/hard coded per platform/driver/target would be easier
i’d imagine. Or it could be broken up into a hybrid system where a
global SDL_Query interface actually makes calls to driver specific query
interfaces.

Also something which I’d imagine useful… all supported SDL platforms
are given an enum type which is never changing after introduction of
functionality. So at run time and without having to worry about this
stuff at compile time, one could find out the platform they are on. Also
include #defines to allow in languages with preprocessors to know what
platform they are on without having to look up each platforms potential
#defines. The runtime part is probably less useful but I can imagine
where scripting languages would possibly find it useful.

I think much of this is harmless to the API and fairly simple to
implement. I’d be happy to develop some of this but I dont want to go
and do this to then have it thrown away.

Bob Pendleton 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 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
measurable.

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
example…):

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?

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 PendletonOn Thu, 2005-09-29 at 18:20 +0100, Tom Wilson wrote:

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

Most languages do not have preprocessors so I fail to see how just using
#ifdef’s is feasible. Plus, all those #def’s could more easily and
consistently be taken care of at compile time of SDL instead of the app
which would use SDL. It seems to me if you wish to make the user of SDL
more cross platform you’d try to hide as much platform specific things
as reasonably possible. SDL has the infrastructure already to figure out
what features and what OS it’s being built on… why not take advantage
of it. Instead of #ifdefs, one could simply have a SDL function saying
whether X is functional/supported and worry about specific
implementation later or simply ignore that functionality. Some things
are just a nicety… like togglefullscreen… and if i cant do it i dont
necessarily need to recreate it… just not offer it. and having
specific #ifdefs does not scale well. If all of a sudden I go and add
support for platform X to SDL and my SDL app doesnt get recompiled with
new #ifdefs… i cant use it. However something like:

SDL_bool
SDL_WM_ToggleFullscreenSupported(void)
{
#if defined X11 || BEOS || whatever
return SDL_TRUE;
#else
return SDL_FALSE;
#endif
}

this works and puts the responsibility on SDL.

In an extreme case, the fact you can remove whole subsystems of SDL from
the library is not accommodated for. I noticed that the WinCE code has 1
or 2 dummy subsystems. It’d be nice to include dummy subsystems for
everything within reason and allow runtime checking for functional
systems. Then you dont need specific platforms to have dummy code like
that. I dont see how all these things which are already known at compile
time causes a query system to be large and complex. Just place a few
#ifdefs in the drivers for things which arent consistent. Many things in
SDL have queryable options. I’d just like to see it used more.

I’d like to be able to find out which driver’s are compiled in instead
of including a list i grabbed off the wiki. I’d like to have a less
bootleg way of requesting a driver to be used. I’d like to see access
methods to parts of SDL that are currently hidden. If you put a few
functions in to allow getting a list of blitters available… a list of
function pointers and so you could benchmark them all and possibly add
your own at runtime. Or access to the function pointers which make up
the subsystem drivers so drivers could be designed and tested without
recompiling SDL. Loaded from a loadable module even. I’d have to look
more around the library since I don’t use it all to come up with more…
but those are pretty simple to add as far as I can tell… and add tons
of power and possibilities to SDL.

as for the SDL_Query idea. I dont know if a completely global query
system or subsystem specific would be better. global would be nice
however it could require some major changes to the build system to
create the database of queryable options. Adding functions per queryable
item which could be generated at compile time with
#ifdefs/configure/hard coded per platform/driver/target would be easier
i’d imagine. Or it could be broken up into a hybrid system where a
global SDL_Query interface actually makes calls to driver specific query
interfaces.

Also something which I’d imagine useful… all supported SDL platforms
are given an enum type which is never changing after introduction of
functionality. So at run time and without having to worry about this
stuff at compile time, one could find out the platform they are on. Also
include #defines to allow in languages with preprocessors to know what
platform they are on without having to look up each platforms potential
#defines. The runtime part is probably less useful but I can imagine
where scripting languages would possibly find it useful.

I think much of this is harmless to the API and fairly simple to
implement. I’d be happy to develop some of this but I dont want to go
and do this to then have it thrown away.

You know, the first word in SDL is “Simple”. You have proposed a lot of
complication that you want added to the Simple Direct media Library. The
only thing you seem to want to be able to query is whether or not toggle
full screen works and what blitters are available. Which is all
documented and available on the wiki. That adds up to two, or maybe
three, functions that I suspect you could code pretty quickly. So, why
don’t you just code that up? You can use it in your own code and maybe
even submit it as a library or as a patch.

As to your desire to add you own blitters to SDL. Feel free. You have
the code and can add anything you want. You don’t need permission and
you don’t need to bother us about it. Just do it. OTOH, if you actually
come up with better blitters than what are already in SDL then submit
them. I’ll bet that they will be put into SDL very quickly.

I, personally, see no value in your proposals. On the other hand I see
that if they are implemented it may well cause me problems. So, of
course, I am opposed to your proposal.

Bob PendletonOn Thu, 2005-09-29 at 14:24 -0400, Antonio SJ Musumeci wrote:

Bob Pendleton 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 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
measurable.

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
example…):

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?


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+

I agree that things should be left simple, but I can think of
a few cases other than fullscreen toggling where a query system
could be useful:

  • OpenGL context loss on SDL_SetVideoMode

Reloading all textures every time the window is resized, for
example, is something that should be avoided if possible …
A function that returns true if the context was lost on the
last SetVideoMode could be nice.

  • Available video driver (“quality” ?)

If the only available video driver is aalib (or caca, etc), I
might want to show a specialized curses-based UI in stead of
having SDL convert images to ultra-low-quality ascii.

  • Latency

If audio latency is large, I might want to delay video a couple
of frames to get better synchronization with video.

  • Gerry

I agree that things should be left simple, but I can think of
a few cases other than fullscreen toggling where a query system
could be useful:

  • OpenGL context loss on SDL_SetVideoMode

Reloading all textures every time the window is resized, for
example, is something that should be avoided if possible …
A function that returns true if the context was lost on the
last SetVideoMode could be nice.

Ok, this one makes some sense. Although, AFAIK, there is only one OS
that does this. It would be nice to query for that bug.

  • Available video driver (“quality” ?)

If the only available video driver is aalib (or caca, etc), I
might want to show a specialized curses-based UI in stead of
having SDL convert images to ultra-low-quality ascii.

I don’t believe this is a serious problem. If it is, then it can be
solved by the existing query functions in SDL.

  • Latency

If audio latency is large, I might want to delay video a couple
of frames to get better synchronization with video.

Are you talking about video latency or audio latency? Audio latency can
be controlled by choosing small buffers. Video latency is nearly
unpredictable, so you pretty much have to adjust your video output to
match the audio stream.

Thank you for pointing out another area where a query may be of use.

	Bob PendletonOn Fri, 2005-09-30 at 19:15 +0200, Gerry JJ wrote:
  • Gerry

SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-------------------------------------+