prosperon/source/engine/input.c

34 lines
500 B
C
Raw Normal View History

2021-11-30 21:29:18 -06:00
#include "input.h"
#include "window.h"
2022-01-19 16:43:21 -06:00
#include <SDL2/SDL.h>
2021-11-30 21:29:18 -06:00
int32_t mouseWheelX = 0;
int32_t mouseWheelY = 0;
int ychange = 0;
int xchange = 0;
float deltaT = 0;
int quit = 0;
SDL_Event e = { 0 };
uint8_t *currentKeystates = NULL;
void input_poll()
{
ychange = 0;
xchange = 0;
mouseWheelX = 0;
mouseWheelY = 0;
currentKeystates = SDL_GetKeyboardState(NULL);
while (SDL_PollEvent(&e)) {
2022-01-19 16:43:21 -06:00
window_all_handle_events(&e);
2021-11-30 21:29:18 -06:00
#ifdef EDITOR
2022-01-19 16:43:21 -06:00
//editor_input(&e);
2021-11-30 21:29:18 -06:00
#endif
}
}