From 7aeafd4f3222d94768935a90d2f6bfaa42416b0c Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Tue, 27 Apr 2021 01:14:36 +0200 Subject: [PATCH] Ne methods Draw_ShowCursor and Input_GetPointerDown --- src/Draw.c | 12 ++++++++++++ src/Draw.h | 6 ++++++ src/Input.c | 7 +++++++ src/Input.h | 5 +++++ 4 files changed, 30 insertions(+) diff --git a/src/Draw.c b/src/Draw.c index 9a9317c..88dce08 100644 --- a/src/Draw.c +++ b/src/Draw.c @@ -1155,3 +1155,15 @@ void Draw_SaveScreenshoot(char *filename) { free(pixelData); #endif } + +///////////////////////////// +// Draw_ShowCursor +// +// +void Draw_ShowCursor(int showCursor) { + if (showCursor) { + SDL_ShowCursor(31); + } else { + SDL_ShowCursor(0); + } +} diff --git a/src/Draw.h b/src/Draw.h index 0a8e19e..e4d73d6 100644 --- a/src/Draw.h +++ b/src/Draw.h @@ -168,4 +168,10 @@ void Draw_SaveRGBAToPNG(char *filename, unsigned char *data, int width, // void Draw_SaveScreenshoot(char *filename); +///////////////////////////// +// Draw_ShowCursor +// +// +void Draw_ShowCursor(int showCursor); + #endif diff --git a/src/Input.c b/src/Input.c index 8d9a36a..499d9a4 100644 --- a/src/Input.c +++ b/src/Input.c @@ -110,6 +110,13 @@ void Input_SetPointerDown(int pointerDown) { _pointerDown = pointerDown; } +///////////////////////////// +// Input_GetPointerDown +// +int Input_GetPointerDown(){ + return _pointerDown; +} + ///////////////////////////// // Input_GetPointerPosition // diff --git a/src/Input.h b/src/Input.h index 2620355..31d5f55 100644 --- a/src/Input.h +++ b/src/Input.h @@ -75,6 +75,11 @@ void Input_SetPointerPosition(float x, float y); // void Input_SetPointerDown(int pointerDown); +///////////////////////////// +// Input_GetPointerDown +// +int Input_GetPointerDown(); + ///////////////////////////// // Input_GetPointerPosition //