SDL Digest, Vol 28, Issue 13

Message: 8
Message-ID: <20060812025359.66135.qmail at web51107.mail.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1

I gather from the lack of replies that what I want to do isn’t
possible—at least not easily. How about adding a new function to the
API for 1.3, something like

SDL_Surface *SDL_SetVideoModeCustom(
int physicalScreenWidth,
int physicalScreenHeight,
int displayWidth,
int displayHeight,
int bpp,
Uint32 flags);

This would use displayWidth and displayHeight for the dimensions of a
display window, to be centered on a fullscreen hardware resolution of
physicalScreenWidth by physicalScreenHeight.

Could something like this make it into the next release? That would
really help me get around the problem I described below.

Mike

Hi,
I think SDL_SetClipRect() might do what you need it to do.
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSetClipRect

Jim> Date: Fri, 11 Aug 2006 22:53:59 -0400 (EDT)

From: Michael Bandsmer
Subject: Re: [SDL] Overriding video mode selection of SDL_SetVideoMode
To: sdl at libsdl.org

Message: 8
Message-ID: <20060812025359.66135.qmail at web51107.mail.yahoo.com>
Content-Type: text/plain; charset=iso-8859-1

I gather from the lack of replies that what I want to do isn’t
possible—at least not easily. How about adding a new function to the
API for 1.3, something like

SDL_Surface *SDL_SetVideoModeCustom(
int physicalScreenWidth, int physicalScreenHeight, int displayWidth, int
displayHeight, int bpp, Uint32 flags);

This would use displayWidth and displayHeight for the dimensions of a
display window, to be centered on a fullscreen hardware resolution of
physicalScreenWidth by physicalScreenHeight.

Could something like this make it into the next release? That would
really help me get around the problem I described below.

Mike

Hi,
I think SDL_SetClipRect() might do what you need it to do.
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSetClipRect

But SDL_SetClipRect does not harm the Mouse Cursor to
go over the edges. You need to read in the Mouse Events and if an event
moves the MouseCursor outside your window, you need to set your mouse
cursor back to you’re screen. You might do a little abstraction
in your code that not a mouse event directly without checking moves
the cursor.

CU

CU>> Date: Fri, 11 Aug 2006 22:53:59 -0400 (EDT)

From: Michael Bandsmer
Subject: Re: [SDL] Overriding video mode selection of SDL_SetVideoMode
To: sdl at libsdl.org

[…]

Hi,
I think SDL_SetClipRect() might do what you need it to do.
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fSetClipRect

Well, it takes care of part of the rendering side of it - but as I
understand it, this is really more about mouse handling. You’d need
to disable the standard mouse pointer and implement your own mouse
event handling, display window movement restriction and cursor
rendering as well. Even though this does work, there are issues, such
as unsmooth mouse pointer motion whenever the application frame rate
drops, and CPU time wasted as a result of not using the hardware
mouse cursor features of the video card.

Also, since the logic to handle this is already in place in SDL, and
makes it completely transparent to the application, it seems kind of
sensible to add an API like that.

As to real life uses: Is bigger really better?

Well, try playing some fast action games full size on a 30" display on
normal desktop viewing distance…! :wink:

I’d find it really rather handy if these physicalScreen(Width|Height)
parameters of the suggested SDL_SetVideoModeCustom() call were also
made available to the end user via environment variables. (As it is,
I can sort of do this by commenting out lower resolution modelines
and restarting my X server, but that’s not really a solution, IMHO…
I’m not even sure there are ways of doing this on all platforms.)

//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 --'On Sunday 13 August 2006 00:51, xucaen wrote: