LibGame  v0.4.0
The LG Game Engine - Copyright (C) 2024 ETMSoftware
lg_mouse.c File Reference

Functions

zboolean lg_get_mouse_state (SDL_Event event, zboolean *left_click, zboolean *right_click, int *dx, int *dy, int *dz_wheel)
 

Detailed Description

 === Mouse-related stuff ===

Function Documentation

◆ lg_get_mouse_state()

zboolean lg_get_mouse_state ( SDL_Event  event,
zboolean *  left_click,
zboolean *  right_click,
int *  dx,
int *  dy,
int *  dz_wheel 
)

Get mouse inputs: left/right click, delta x/y since last call IF left or right button is pressed, wheel actions since last call

=== This is the func you can/should use to get mouse inputs inside the game main loop ===

Does NOT invoke SDL_PollEvent()

Parameters
eventA SDL_Event
left_clickPointer to zboolean that will get left clicks
right_clickPointer to zboolean that will get right clicks
dxPointer to int that will get delta x since last call
dyPointer to int that will get delta y since last call
dz_wheelPointer to int that will get delta z (wheel forward/backward motions) since last call
Returns
TRUE if there was some mouse activity, FALSE otherwise