Keyrepeat issues. |
elpatolocosisi
|
Ok, so I did a little more testing. I tried the same code in a 32bit Debian (virtual machine) and a 32bit Archlinux (different computer) and had no problems whatsoever... so this issue seems to be with this particular system. I don't really think it being 64bits would change anything, but at this point I'm at a complete loss as of what to do.
I've read some posts where they talk about handling this within the Xserver, but that would defeat the whole purpose of portability I'm trying to achieve with SDL here. I guess I could solve this with timers and such, but it really shouldn't be that complicated... |
|||||||||||
|
elpatolocosisi
|
After a couple of more tries I'm now guessing this might be some kind of bug with SDL2, I did two things:
(to differentiate the computers, the one I had the problem with will be my desktop PC and the other my netbook) 1) Created a very very basic Archlinux live image with archiso. It only had the basic plus nvidia-drivers (intel for netbook), sdl2, xorg (server + utils) and xterm. Tried booting into it, both 32 and 64bit, with the desktop PC and had no luck whatsoever. After trying the 32bit in my netbook I almost got it working, when holding down a key, I would still get both DOWN and UP events but only a couple every 1 or 2 minutes (which is quite weird since it does work in the installed 32bit Arch),, whereas the desktop PC prints them continuously. 2) Same thing but with Debian wheezy, using debootstrap, for a 64bit Debian image. Netbook worked perfectly, not even those sporadic ones every couple of minutes, just great. Desktop PC still has the same problem. I also booted into Windows XP 32bit in the desktop PC (I have it installed alongside Arch) and the code worked with no problems. So I'm guessing there's some weird bug or something with SDL2 plus certain hardware... and when in linux... ?? |
|||||||||||
|
Ryuuguu
|
I have a related question. Is there a way to clear the event queue? It seems that events get queued up for far too long. Right now my game runs at about 60 fps (mostly due to using rendercopy but I am moving to opengl to hopefully speed things up). The main loops goes like this:
Draw->Get Inputs->Update Positions/do logic->Draw. Keys seem to be stuck in the event queue for a few seconds after release. |
|||||||||||
|
Ryuuguu
|
Nevermind. I needed to add a while loop with SDL_PollEvent function like this:
while (SDL_PollEvent(event)){ ..Input Proccessing... } I don't really understand why though. |
|||||||||||
|