#include "xr_mouse.h"

#include <SDL.h>

#include "mouse.h" // engine/src/Libraries/INPUT/Source/mouse.h - mouse_put_xy()

void xr_mouse_move(int x, int y) { mouse_put_xy((short)x, (short)y); }

void xr_mouse_click(bool down) {
    SDL_Event event;
    SDL_zero(event);
    event.type = down ? SDL_MOUSEBUTTONDOWN : SDL_MOUSEBUTTONUP;
    event.button.timestamp = SDL_GetTicks();
    event.button.windowID = 0;
    event.button.which = 0;
    event.button.button = SDL_BUTTON_LEFT;
    event.button.state = down ? SDL_PRESSED : SDL_RELEASED;
    event.button.clicks = 1;
    SDL_PushEvent(&event);
}
