SDL Input problem
Posted: Sun Jul 08, 2012 4:54 pm
Well, i am making a engine, and my input core is not working corectly, it looks something like this:
that is for the Input.h
now the input.cpp:
and in the main funtion i use it like this:
but the problem is that it doesnt do anything!!
any suggestions??
Code: Select all
class acInput
{
acInput();
bool acKeyDown(Key key) //this is an enum of keys i made
...
now the input.cpp:
Code: Select all
#include "input.h"
...
bool acInput::acKeyDown(Key key)
{
Uint8 *keystates = SDL_GetKeyState(NULL);
if(keystates[key])
return true;
}
Code: Select all
int main(int argc,char *argv[])
{
...
acInput input;
...
if(input.acKeyDown(KEY_UP)
{
//Do something, but it doesnt work!!!!!
}
any suggestions??