Broken Mug Engine - Input

SDL2 is used for keyboard and mouse input.

In the main game loop SDL_PollEvent is called and SDL_Event events are sent to my SDL_Input class to handle input events. All input data is stored in my InputState class, so it can be used later in GUI or game logic, and GUI or game are notified about the received event.

SDL_KeyPress(int key);
SDL_KeyRelease(int key);

SDL_MousePress(int bttn);
SDL_MouseRelease(int bttn);
SDL_MouseWheelX(int x);
SDL_MouseWheelY(int y);
SDL_MouseMotion(int x, int y, int dx, int dy);

Maybe I should change the names, so my functions are more distinguishable from SDL functions :/

No comments:

Post a Comment