pouët.net

Go to bottom

Mousecursors in 4k Intros

category: code [glöplog]
For me, the problem, is that ShowCursor(0), after the synth wave generation and intro loading, just before the main loop, removes the cursor on my coding PCs, but never does on the damn compo-machines, so no way to reproduce the issue locally.

Is PeekMessage the "good way" (tm) to fix it? If so, any documentation on the issue (google didn't show any meaningful results)?
added on the 2012-04-11 00:37:59 by shash shash
At least it prevents the actual problem (Windows thinking "noone's caring about my messages!") from happening.
while( ShowCursor(0)>0 ); should probably fix the problems too (see doc)
added on the 2012-04-11 00:41:56 by iq iq
iq: interesting :)
added on the 2012-04-11 08:13:37 by maytz maytz
so, if the system hasn't got a mouse iq's code will hang
which is obviously everyone's primary concern :P
added on the 2012-04-11 08:43:20 by ferris ferris
I tried the while(showcursor(0)>0) and calling showcursor(0) + setcursor(0) every frame but it did not help. Only solution that helped was to call the one las gave on first message (call showcursor+peekmessage). This is with OpenGL and win7..
added on the 2012-04-11 08:50:39 by rale rale
i really don't see the problem with the mouse cursors. if it bothers you - just move it out side the screen!
Quote:

while( ShowCursor(0)>0 ); should probably fix the problems too (see doc)

1. the iq variant would introduce some branching + condition code checking - that's might not be that optimal entropy wise (but you never know without trying).
2. I doubt it works (but I might be wrong there)
3. If it does: actually having no mouse HAPPENS. I have a synergy setup here - only one of the PCs has a mouse.

Quote:

removes the cursor on my coding PCs, but never does on the damn compo-machines, so no way to reproduce the issue locally.

Try to disable vsync in your driver - with vsync on - the cursor is gone like in 2004 - at least on this win7 64 setup.

And I really would like to know whether the approach in the first post of this thread works everywhere (for OpenGL 4k stuff). Maybe we can come up with something better.
added on the 2012-04-11 08:59:14 by las las
Excessive calling of Showcursor(0) does not help on my System. So far the only solution for me is the Peakmessage one las posted.
added on the 2012-04-11 09:17:30 by chock chock
maytz: Who in the world uses MFC for 4ks?
added on the 2012-04-11 10:14:46 by xTr1m xTr1m
Nobody.
Therefore - I guess: Nope.
added on the 2012-04-11 10:16:28 by las las
doh :)
added on the 2012-04-11 12:22:01 by maytz maytz
That said, those MFC calls are just wrapped WinAPI calls with more or less exactly the same names.
Makes it very tempting to make a prod for Solskogen where the mouse cursor will (after a bit) start flying around in a spline path, making the darklite member who holds the cardboard jump around :)

(hey, maybe that would be a category on its own: 4ks with live performance! Each showing will be unique!)
added on the 2012-04-11 18:34:13 by すすれ すすれ
Let me push this back up again - 3 of 5 4k intro entries at Evoke 2012 failed at hiding the mousecursor. We need a compo rule. Everywhere.
added on the 2012-08-15 12:54:17 by las las
i dont get this cursor hate. be friendly, love thy cursor.
Bah, we had this same whining about prods without "exit" feature. Who cares, just reboot the damn machine.
added on the 2012-08-15 13:42:44 by 216 216
Rebooting takes too long...
added on the 2012-08-15 13:59:39 by trc_wm trc_wm
Aehm this has nothing to do with rebooting the machine.
added on the 2012-08-15 14:21:02 by las las
On a related note, in all my tests the cursor does the loading circle instead of an arrow, and you have to move it away from the window and back in to get the normal pointer. Is there a known cause for this?
added on the 2012-08-15 14:39:20 by msqrt msqrt
@msqrt: XP did the same, you got the wait hourglass.

This is just guessing, but I'm presuming Windows shows the wait cursor when executing the program, and when the program doesn't set a cursor in its window class it doesn't change from that. Moving it out of the window causes the desktop or another program that DOES set a cursor to change it to the normal arrow.
added on the 2012-08-15 18:34:30 by Subi Subi
That's because people "forget" to actually clear the message loop so windows thinks the program is busy and display the wait cursor.
True, if you're using a predefined class (like Edit) then it should have a cursor set.
added on the 2012-08-15 18:50:27 by Subi Subi

login

Go to top