SDL_Video - Help with fullscreen, suppressed mouse

Okay, I’m just about to give up. Some suggested the SVN snapshot might
offer a fix for this however, after trying my best to compile from svn I
give up! I had to install MSYS, ActivePerl (I assume this will work) and
then autoconf is complaining about Autom4te/C4che.pm. This is
ridiculous! I just want to display a fullscreen SDL app with the mouse
pointer suppressed and get accurate mouse click coordinates. Is SDL not
ready for prime time yet? I don’t mean this as an insult but this seems
like a fundamental problem that is making me wonder what I am doing
wrong over and over again.

sigh Does someone already have the latest SVN snapshot of 1.2 SDL for
win32? I’d like the developer libs and sdl.dll all ready to go (no
compile). I’ve spent half a day on this and there’s no guarantee that
"upgrading" will even fix this. My apologies, in advance, if this is
rubbing anyone the wrong way. I’m just getting VERY frustrated.

I really would like to use SDL, but the support for it seems rather
lacking. If I was trying to do something fancy with OpenGL I could
understand the slow response. But trying to get a suppressed mouse to
register clicks correctly?

One last wave of asking for help and then I give up. I’ll have to use
direct win32 calls and scrap SDL as not being mature enough (which is
what my customer is interpreting what I am telling him about the snafu).

Would updating my ticket in bugzilla get a quicker response? Is there
another official response path that I can go? I’m willing to put in as
much effort as I can to assist but I’m not sure how to get assistance.
Other than the ticket assigned to someone on the same day I posted it
(8/23), nothing has happened to the ticket since I first put it in.------------------------
Message: 17
Date: Wed, 6 Sep 2006 10:15:18 -0700
From: @Damian_Sobieralski (Damian Sobieralski)
Subject: Re: [SDL] SDL_Video - Help with fullscreen, suppressed mouse
and mouse click coords
To:
Cc: wizard at syntheticsw.com
Message-ID:

<18050B668B2B784DB0A083D65ED5287F01E8FB90 at EX01.asurite.ad.asu.edu>
Content-Type: text/plain; charset=“us-ascii”

From: Torsten Giebl <wizard syntheticsw.com>
Subject: Re: SDL_Video - Help with fullscreen, suppressed mouse and
mouse click coords

Why are you calling SDL_ShowCursor hiding and showing in
your main loop ?

So that I can see where the mouse cursor is at so I know where I am
clicking. Otherwise, in fullscreen mode, how am I going to know where I
am clicking if I dont cycle it like that (if there’s a better way,
please let me know)?

Please checkout also the latest SDL SVN version.

sigh I tried that and followed the instruction at:

http://www.libsdl.org/extras/win32/mingw32/README.txt

I installed MSYS but when I go into the SDL directory and try to issue
./configure I get an error “sh: ./configure no such file or directory”.
There is no configure script in the 1.2 SVN checked out tree that I
have.

Hello !

I installed MSYS but when I go into the SDL directory and try to issue
./configure I get an error “sh: ./configure no such file or directory”.
There is no configure script in the 1.2 SVN checked out tree that I
have.

Yes, you need first to run ./autogen.sh
to get the configure file written.

CU

Hello !

I just tested it on my system :

When using DirectX it is possible to move the cursor
around and click on every point you want.

When you use GDI when calling SDL_ShowCursor the Cursor gets
centered. Is this a bug or a feature ? Normally SDL_ShowCursor
should not do anything to the Mouse position, that is what SDL_WarpMouse
is normally for.

CU

Hello !

Okay, I’m just about to give up. Some suggested the SVN snapshot might
offer a fix for this however, after trying my best to compile from svn I
give up! I had to install MSYS, ActivePerl (I assume this will work) and
then autoconf is complaining about Autom4te/C4che.pm. This is ridiculous!
I just want to display a fullscreen SDL app with the mouse
pointer suppressed and get accurate mouse click coordinates. Is SDL not
ready for prime time yet? I don’t mean this as an insult but this seems
like a fundamental problem that is making me wonder what I am doing wrong
over and over again.

It has been used in a lot of commercial games.
But as everything it has bugs.

CU

Hello Damian,

Thursday, September 7, 2006, 12:34:02 AM, you wrote:

Okay, I’m just about to give up. Some suggested the SVN snapshot might
offer a fix for this however, after trying my best to compile from svn I
give up! I had to install MSYS, ActivePerl (I assume this will work)

You just discovered mingw is not a proper Unix environment which is
what the build scripts expect. If you want to build SDL I would
recommend cygwin instead. You can use the built binaries with mingw.

I just want to display a fullscreen SDL app with the mouse
pointer suppressed and get accurate mouse click coordinates. Is SDL not
ready for prime time yet? I don’t mean this as an insult but this seems
like a fundamental problem that is making me wonder what I am doing
wrong over and over again.

I really would like to use SDL, but the support for it seems rather
lacking. If I was trying to do something fancy with OpenGL I could
understand the slow response. But trying to get a suppressed mouse to
register clicks correctly?

This works for me with the DirectX backend. Be aware that as of late,
the default backend is GDI (which I don’t agree with). You can switch
it either by a) building your own SDL with only DirectX support or
b) inserting the following line before you call SDL_Init()

SDL_putenv(“SDL_VIDEODRIVER=directx”);

One last wave of asking for help and then I give up. I’ll have to use
direct win32 calls and scrap SDL as not being mature enough (which is
what my customer is interpreting what I am telling him about the snafu).

I’ve used it in several commercially shipping Mac games.

Would updating my ticket in bugzilla get a quicker response? Is there
another official response path that I can go? I’m willing to put in as
much effort as I can to assist but I’m not sure how to get assistance.
Other than the ticket assigned to someone on the same day I posted it
(8/23), nothing has happened to the ticket since I first put it in.

Such is the nature of open source. The benefit is, as you have the
source to SDL, you can dig into the bowels of it and find the problem,
and fix it. Yes, this is another job to do when you’re developing
something commercial, but it pays for itself quickly.–
Best regards,
Peter mailto:@Peter_Mulholland

Peter,

SDL_putenv(“SDL_VIDEODRIVER=directx”);

Although that did seem to allow me to record coordinates correctly,
when I disabled the cursor the mouse pointer seemed to randomly
jitter/jump all over as I moved the mouse.

and fix it. Yes, this is another job to do when you’re developing
something commercial, but it pays for itself quickly.

True. But I’m looking to use SDL for a small project so becoming a full
developer in it doesn’t seem like a good use of my time.

I like a lot of wha tI’ve seen in SDL. So, although it soured me a bit
on this project, I intend to continue to use it.

BTW- I found a useful workaround (suggested by someone else). I removed
the directX command that you so kindly supplied. I enabled the cursor
(as clicks seem to work with it on) but used SDL_CreateCursor() to
create a customized transparent one. Seems to work fine so far.

And speaking of which, the docs on SDL_CreateCursor kinda…uhhhh…
leave something to be desired. Does anyone have a tutorial on using
this?

  • Damian

Damian Sobieralski wrote:

I just want to display a fullscreen SDL app with the mouse
pointer suppressed and get accurate mouse click coordinates. Is SDL not
ready for prime time yet? I don’t mean this as an insult but this seems
like a fundamental problem that is making me wonder what I am doing
wrong over and over again.

I really would like to use SDL, but the support for it seems rather
lacking. If I was trying to do something fancy with OpenGL I could
understand the slow response. But trying to get a suppressed mouse to
register clicks correctly?

I think the reason for the slow response is just that your problem is
not known to any of us. We’re as helpless about it as you are. And if
nobody happens to have time to try to reproduce it, and if successful,
debug it - sorry, but you just have to live with that in an open source
project.

For the record, my primary SDL application (http://pipmak.sf.net/) works
just fine on Windows in fullscreen with hidden mouse cursor - and as far
as I imagine, countless others do as well. But since Windows is not my
main OS (I’m cross-compiling the Windows version on Mac OS X), I don’t
think I can be of much help in this cause.

-Christian

Hello !

I think the reason for the slow response is just that your problem is
not known to any of us. We’re as helpless about it as you are. And if
nobody happens to have time to try to reproduce it, and if successful,
debug it - sorry, but you just have to live with that in an open source
project.

For the record, my primary SDL application (http://pipmak.sf.net/) works
just fine on Windows in fullscreen with hidden mouse cursor - and as far as
I imagine, countless others do as well. But since Windows is not my
main OS (I’m cross-compiling the Windows version on Mac OS X), I don’t
think I can be of much help in this cause.

As in my last email on my system with DirectX everything works okay.
But when using GDI SDL_ShowCursor when switching between ENABLED
/DISABLED or vice versa it centers the MouseCursor in Fullscreen Mode
and as he uses in his mainloop MouseCursor SwitchOn/Off every loop
SDL always centers the MouseCursor before asking for Events.

I am interested if other people with Windows and using GDI with SDL
could reproduce this problem.

CU

Torsten Giebl wrote:

and as he uses in his mainloop MouseCursor SwitchOn/Off every loop
SDL always centers the MouseCursor before asking for Events.

True. But I also pulled those calls outside the loop and called with
SDL_DISABLE just once and the same thing happens.

I am interested if other people with Windows and using GDI with SDL
could reproduce this problem.

Me too. The transparent custom cursor gives me a work around. So I’m
happy. But it does appear something screwy is going on with the cursor
disabling and fullscreen mode with recent SDL.

[…]

As in my last email on my system with DirectX everything works okay.
But when using GDI SDL_ShowCursor when switching between ENABLED
/DISABLED or vice versa it centers the MouseCursor in Fullscreen
Mode and as he uses in his mainloop MouseCursor SwitchOn/Off every
loop SDL always centers the MouseCursor before asking for Events.

Hmm… Maybe this is related to the problem I’m having in a GUI
toolkit of mine…? (EBGUI; GUI toolkit implemented in EEL over SDL
via EELBox.)

The offending widget can be dragged and scaled by moving the mouse
along the ruler and perpendicular to the ruler, respectively. As it’s
(more or less) endless in both dimensions, the widget hides the
cursor and makes use of SDL_WarpMouse() to get relative mouse
movement while dragging/scaling.

My problem is that if I’m moving the mouse as I grab the ruler (which
results in the widget hiding the cursor and grabbing input), I often
get a huge jump. IIRC, this is actually passed as a number of move
events, apparently clamped to the window/screen size.

This only happens if the cursor is moving at the moment the widget
hides it, as far as I can tell.

If I disable the cursor hiding, it works perfectly every time - well,
except for that silly looking cursor jittering about in the middle of
the window. :slight_smile:

I am interested if other people with Windows and using GDI with SDL
could reproduce this problem.

The problem I’m seeing appears on X11/Linux as well. Also, it happens
in windowed mode as well as fullscreen mode, at least on Linux.
Haven’t tried it on OS X yet.

//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 Thursday 07 September 2006 19:25, Torsten Giebl wrote: