Permalink
Browse files

Show/hide cursor functions

Instead of `S2D_ShowCursor(bool)`, use `S2D_ShowCursor()` and `S2D_HideCursor()`
  • Loading branch information...
blacktm committed Jan 1, 2019
1 parent 1d5b289 commit 4b231c67386c313e048d92c490285b8b626183b2
Showing with 18 additions and 9 deletions.
  1. +7 −2 include/simple2d.h
  2. +11 −7 src/input.c
@@ -596,9 +596,14 @@ void S2D_FreeMusic(S2D_Music *mus);
void S2D_GetMouseOnViewport(S2D_Window *window, int wx, int wy, int *x, int *y);

/*
* Show or hide the cursor over the window
* Show the cursor over the window
*/
void S2D_ShowCursor(bool toggle);
void S2D_ShowCursor();

/*
* Hide the cursor over the window
*/
void S2D_HideCursor();

// Controllers /////////////////////////////////////////////////////////////////

@@ -33,12 +33,16 @@ void S2D_GetMouseOnViewport(S2D_Window *window, int wx, int wy, int *x, int *y)


/*
* Show or hide the cursor over the window
* Show the cursor over the window
*/
void S2D_ShowCursor(bool toggle) {
if (toggle) {
SDL_ShowCursor(SDL_ENABLE);
} else {
SDL_ShowCursor(SDL_DISABLE);
}
void S2D_ShowCursor() {
SDL_ShowCursor(SDL_ENABLE);
}


/*
* Hide the cursor over the window
*/
void S2D_HideCursor() {
SDL_ShowCursor(SDL_DISABLE);
}

0 comments on commit 4b231c6

Please sign in to comment.