In my game, the buttons and mouse sometimes take a while to respond to clicks, but not to clicks that just use dbMouseClick and dbKeyState() but when I put in checks to find out when it is pressed once. This is the gist of my code:
// at the top, before while loop
int lastKey;
int lastMouse;
bool Input::KeyOnce (int key) {
return (dbKeyState(key) && lastKey != key) ? true : false;
}
bool Input::MouseClickOnce (int click) {
return (dbMouseClick() == click && lastMouse != click) ? true : false;
}
// in the loop at the end:
lastKey = dbScanCode();
lastMouse = dbMouseClick();
dbSync();
When I use "Input::KeyOnce(17)" for W key, it sometimes doesn't respond to it and I have to press the button lots to get it to register ??? It has become more noticeable when I have uncapped the FPS, is that why?
Your signature has been erased by a mod