MochiEngine
Loading...
Searching...
No Matches
Mochi::Input::SDLMouseProvider Class Reference

Implementation of IMouseProvider that uses SDL_GetMouseState and SDL_RenderCoordinatesFromWindow to retrieve mouse data. More...

#include <SDLMouseProvider.h>

Inheritance diagram for Mochi::Input::SDLMouseProvider:
Mochi::Input::IMouseProvider

Public Member Functions

 SDLMouseProvider (const Graphics::IRenderer *renderer)
virtual std::array< bool, MouseButton::MouseButtonsCount > GetState (float *x, float *y) const override
 Gets the state of the mouse, consisting of the pointer position in the screen and each of its buttons, defined in InputCommons.h in the MouseButtons enum.

Detailed Description

Implementation of IMouseProvider that uses SDL_GetMouseState and SDL_RenderCoordinatesFromWindow to retrieve mouse data.

Member Function Documentation

◆ GetState()

std::array< bool, MouseButton::MouseButtonsCount > Mochi::Input::SDLMouseProvider::GetState ( float * x,
float * y ) const
overridevirtual

Gets the state of the mouse, consisting of the pointer position in the screen and each of its buttons, defined in InputCommons.h in the MouseButtons enum.

Parameters
xReference to a value that will be updated in the method with the X position.
yReference to a value that will be updated in the method with the Y position.
Returns
An array of booleans for each mouse button, up to InputCommons.h in the MouseButtons enum.

Implements Mochi::Input::IMouseProvider.


The documentation for this class was generated from the following files: