[PATCH] Function to get desktop resolution

Is it correct to perform the same thing differently on two SDL versions ?
Do we want source compatilibity for new SDL versions ?

Not especially, but I’m not going to add much in the way of hacks to SDL 1.2,
especially if 1.3 is going to do it right. :slight_smile:

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

How do people feel about adding the desktop resolution to the video info
as opposed to having a separate explicit function to get it? A separate
function might be more intuitive for the developer.

Seperate function.

–ryan.

If you do add a seperate function to do this, it would be nice if it
returned the current bitdepth as well.

By the way, what about virtual (scrolling) desktops ? Should there be
two functions, one for “logical” and one for “physical” size ?

  • Gerry

IIRC, the multi-desktop/multi-window features are planned for SDL2.0.

/OlofOn Mon, 14 Feb 2005 21:04:01 +0100, Gerry wrote:

If you do add a seperate function to do this, it would be nice if it
returned the current bitdepth as well.

By the way, what about virtual (scrolling) desktops ? Should there be
two functions, one for “logical” and one for “physical” size ?

  • Gerry

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

Gerry wrote:

If you do add a seperate function to do this, it would be nice if it
returned the current bitdepth as well.

I was thinking this was available from SDL_VideoInfo, but I see that’s
the best bpp, not the current one. So I agree, this would be a useful
addition to the function.

By the way, what about virtual (scrolling) desktops ? Should there be
two functions, one for “logical” and one for “physical” size ?

Well, since the programmer almost certainly wants this information to
select a fullscreen mode, I think physical is the one they would want to
know about. I should note that the patch I submitted is broken in this
respect, it returns the size of the desktop, not the current resolution
on X11. I didn’t see an obvious way of getting the resolution from Xlib.
Perhaps I have to use the VidMode extension if available. I’ll have a
look at this soon.–
Jon

Gerry wrote:

If you do add a seperate function to do this, it would be nice if it
returned the current bitdepth as well.

I was thinking this was available from SDL_VideoInfo, but I see that’s
the best bpp, not the current one. So I agree, this would be a useful
addition to the function.

By the way, what about virtual (scrolling) desktops ? Should there be
two functions, one for “logical” and one for “physical” size ?

Well, since the programmer almost certainly wants this information to
select a fullscreen mode, I think physical is the one they would want to
know about. I should note that the patch I submitted is broken in this
respect, it returns the size of the desktop, not the current resolution
on X11. I didn’t see an obvious way of getting the resolution from Xlib.
Perhaps I have to use the VidMode extension if available. I’ll have a
look at this soon.

I think we have a mindset problem here: is there programmer using SDL
to build a game or a general multimedia app…?

/OlofOn Mon, 14 Feb 2005 21:29:06 +0000, Jon Colverson wrote:


Jon


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

Olof Bjarnason wrote:

Well, since the programmer almost certainly wants this information to
select a fullscreen mode, I think physical is the one they would want to
know about. I should note that the patch I submitted is broken in this

I think we have a mindset problem here: is there programmer using SDL
to build a game or a general multimedia app…?

Well, I had games in mind. Would a “general multimedia app” want to use
the whole virtual screen? I suppose it might.> On Mon, 14 Feb 2005 21:29:06 +0000, Jon Colverson <@Jon_Colverson> wrote:


Jon

I think so too. And in general, I think SDL2.0 will have to address
this issue - SDL is used as a general low-level multimedia API (after
all the name is Simple Directmedia Library), thus should not assume
"one window" or “one physical screen” etc. Or, SDL could change
direction slightly and go for the low-level games API idea instead.
The question “how do I create multiple windows” is one of the most
frequently asked questions since I joined this list two years ago.

/OlofOn Wed, 16 Feb 2005 05:31:38 +0000, Jon Colverson wrote:

Olof Bjarnason wrote:

On Mon, 14 Feb 2005 21:29:06 +0000, Jon Colverson wrote:

Well, since the programmer almost certainly wants this information to
select a fullscreen mode, I think physical is the one they would want to
know about. I should note that the patch I submitted is broken in this

I think we have a mindset problem here: is there programmer using SDL
to build a game or a general multimedia app…?

Well, I had games in mind. Would a “general multimedia app” want to use
the whole virtual screen? I suppose it might.


Jon

I was thinking of games too. But, the way I see it, games are
multimedia applications! All you accomplish by introducing an
artificial distinction between the two is limit the kind of games you
can create with SDL.

For example, Fish Fillets NG use multiple windows and game-controlled
window positioning, Eyetoy, DDR and karaoke games use special input
devices, a Pictionary-like game could use a tablet/pressure-sensitive
pen, flight simulators and other 3D games could use extra monitors for
more views (I think Flight Gear supports this, actually), there’s even
games that use a MIDI keyboard for input. Then you could imagine a game
using several of these devices… Take a general vehicle-based FPS, add
a videowindow for controlling the vehicle, use microphone to talk to
others, and use a DDR mat for summoning magical creatures by tapdancing.
I’m not saying it’s in the scope of SDL to actively support all this,
just that for many games the game / multimedia seperation isn’t so big.
So, some general support would be nice, at least.

Anyway, getting the current desktop resolution is useful for more than
preventing modeswitching. Any game that is running windowed could use
the information to figure out if the window is bigger than the logical
or physical desktop, and based on that switch to fullscreen or maybe add
some window positioning. It could also be used for adding seemless
transitions into a game (fx, grab desktop image, create a fullscreen
window with it, melt).

  • Gerry

Olof Bjarnason wrote:> I think so too. And in general, I think SDL2.0 will have to address

this issue - SDL is used as a general low-level multimedia API (after
all the name is Simple Directmedia Library), thus should not assume
"one window" or “one physical screen” etc. Or, SDL could change
direction slightly and go for the low-level games API idea instead.
The question “how do I create multiple windows” is one of the most
frequently asked questions since I joined this list two years ago.

/Olof

On Wed, 16 Feb 2005 05:31:38 +0000, Jon Colverson wrote:

Olof Bjarnason wrote:

On Mon, 14 Feb 2005 21:29:06 +0000, Jon Colverson wrote:

Well, since the programmer almost certainly wants this information to
select a fullscreen mode, I think physical is the one they would want to
know about. I should note that the patch I submitted is broken in this

I think we have a mindset problem here: is there programmer using SDL
to build a game or a general multimedia app…?

Well, I had games in mind. Would a “general multimedia app” want to use
the whole virtual screen? I suppose it might.


Jon


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

Olof Bjarnason wrote:

Well, since the programmer almost certainly wants this information to
select a fullscreen mode, I think physical is the one they would want to
know about. I should note that the patch I submitted is broken in this

I think we have a mindset problem here: is there programmer using SDL
to build a game or a general multimedia app…?

Well, I had games in mind. Would a “general multimedia app” want to use
the whole virtual screen? I suppose it might.

SDL is intended to be, and is consistently growing into, a general
multimedia API. I think of games as a subset of general multimedia
applications. So, if a game needs it then it should be there.

I think one of the things that makes SDL good for general multimedia is
that it is good for games.

Just my two cents.

	Bob PendletonOn Wed, 2005-02-16 at 05:31 +0000, Jon Colverson wrote:

On Mon, 14 Feb 2005 21:29:06 +0000, Jon Colverson wrote: