[SDL] Overriding video mode selection of SDL_SetVideoMode

Michael Bandsmer mbandsmer at yahoo.com
Sat Aug 12 11:54:21 PDT 2006


What you describe, Torsten, could be used for Aleph One perhaps, but
for my application I want a mouse cursor that is visible and moves
around the display window like a normal mouse cursor, except that I
don't want the mouse to move beyond the edges of the display window. 
This seems to be the default behavior after a fullscreen
SDL_SetVideoMode with a display window that is smaller than
hardware-resolution.

I'm sure there's a way to constrain the mouse cursor in this way by
processing mouse move events myself and using the shadow surface you
described earlier and appropriately converting coordinates, etc.  But
it seems a cleaner solution to simply extend SDL's API to set the
hardware resolution independently of the display window size, since
it's clear SDL can already handle this.  All I would need is an API
function for it, e.g. from my earlier email, something like

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

Has the API for 1.3 been finalized yet, or could something like this
still make it in?

Mike

--- Torsten Giebl <wizard at syntheticsw.com> wrote:

> Hello !
> 
> 
> > I'm not sure whether using a shadow surface would constrain the
> mouse
> > cursor to stay within the display window, which is something I also
> need.
> > It would be nice to use SDL's built-in mouse constraining
> > feature rather than re-invent the wheel.
> 
> 
> You can use it, just set after every mouse move event the
> Mouse Cursor to the center of your window. To get for example
> a movement like in DOOM. You should turn the Mouse Cursor Sprite
> off.
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 




More information about the SDL mailing list