Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - kurokaze

Pages: [1]
1
General / [solved] Stuck in event loop with JoyButtonReleased
« on: August 25, 2008, 12:24:27 am »
Whenever I use an event loop as presented in the tutorials onsite, my program gets stuck in the loop. App.GetEvent(Event) never returns FALSE. This is reproduced in e.g. the exact source of the OpenGL tutorial.

Based on a switch I threw in, the offending repeating event is of type JoyButtonReleased.

Removing my joystick had no effect. Rebooting with it removed did solve the issue. However, it returned as soon as the joystick was reinserted.

I'm rather uninterested in developing a program that requires a reboot to work, so I really need to work around this problem somehow.

I'm using the latest MinGW with the precompiled DLL version of SFML. I'll try static and compiling it myself, and the SVN, but I thought I'd see if anyone has experienced anything similar.

One obvious possibility is that my joystick driver really is sending constant button release messages, but I'd think I'd have run into trouble with other programs if that were the case. Something wrong on the SFML side seems more likely. Or PEBKAC.

I thought about working around it via a simple "if(Event.Type == sf::Event::JoyButtonReleased) break;" since I don't actually need the joystick for my program, but that could easily cause other events to be missed if they got stacked under the JoyButtonReleased event.

Edit: This appears to be due to the fact that my joystick has 13 buttons plus an 8-way hat, and SFML 1.3 uses a 16-element array to track button states. Changing the array size to 32 fixes the problem and I see this has been done in SVN along with a check to prevent similar data corruption in the future. Good work. :)

On the minus side my joystick produces no events after the fix (before the fix it didn't produce any events other than the Release spam either), but again, it is unnecessary to my program so this is by no means a deal-breaker.

Pages: [1]
anything