- Afegit soport per a ratolí

This commit is contained in:
2023-06-04 18:27:39 +02:00
parent f92d483cde
commit 5cf871caed
3 changed files with 48 additions and 0 deletions

View File

@@ -46,4 +46,22 @@ namespace input
keypressed = key;
}
int mouseX()
{
int x;
SDL_GetMouseState(&x, NULL);
return x;
}
int mouseY()
{
int y;
SDL_GetMouseState(NULL, &y);
return y;
}
bool mouseBtn(int btn)
{
return (SDL_GetMouseState(NULL, NULL) & SDL_BUTTON(btn));
}
}