From ee4b553c2a7bb0784b53583988c60e023f340220 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 26 Feb 2015 13:52:03 +0100 Subject: [PATCH] Renamed some functions --- src/core.c | 43 ++++++++++++++++++++++--------------------- src/models.c | 2 +- src/raylib.h | 7 ++++--- 3 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/core.c b/src/core.c index 8d8795cd..bfd24a85 100644 --- a/src/core.c +++ b/src/core.c @@ -99,6 +99,8 @@ //---------------------------------------------------------------------------------- #define MAX_TOUCH_POINTS 256 +// Camera System configuration +//---------------------------------------------------------------------------------- // CAMERA_GENERIC #define CAMERA_SCROLL_SENSITIVITY 1.5 @@ -220,7 +222,7 @@ static bool cursorOnScreen = false; // Tracks if cursor is inside client static Texture2D cursor; // Cursor texture static Vector2 mousePosition; -static bool mouseHidden; +static bool cursorHidden; static char previousKeyState[512] = { 0 }; // Required to check if key pressed/released once static char currentKeyState[512] = { 0 }; // Required to check if key pressed/released once @@ -864,7 +866,7 @@ int GetMouseWheelMove(void) } #endif -void HideMouse() +void HideCursor() { #if defined(PLATFORM_DESKTOP) #ifdef __linux @@ -880,10 +882,10 @@ void HideMouse() glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_HIDDEN); #endif #endif - mouseHidden = true; + cursorHidden = true; } -void ShowMouse() +void ShowCursor() { #if defined(PLATFORM_DESKTOP) #ifdef __linux @@ -892,12 +894,12 @@ void ShowMouse() glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_NORMAL); #endif #endif - mouseHidden = false; + cursorHidden = false; } -bool IsMouseHidden() +bool IsCursorHidden() { - return mouseHidden; + return cursorHidden; } // TODO: Enable gamepad usage on Rapsberry Pi @@ -1059,20 +1061,6 @@ Vector2 GetTouchPosition(void) }*/ #endif -// Initialize OpenGL graphics -void InitGraphics(void) -{ - rlglInit(); // Init rlgl - - rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) - - ClearBackground(RAYWHITE); // Default background color for raylib games :P - -#if defined(PLATFORM_ANDROID) - windowReady = true; // IMPORTANT! -#endif -} - void InitPostShader(void) { rlglInitPostpro(); @@ -1346,6 +1334,19 @@ static void InitDisplay(int width, int height) #endif } +// Initialize OpenGL graphics +static void InitGraphics(void) +{ + rlglInit(); // Init rlgl + + rlglInitGraphics(renderOffsetX, renderOffsetY, renderWidth, renderHeight); // Init graphics (OpenGL stuff) + + ClearBackground(RAYWHITE); // Default background color for raylib games :P + +#if defined(PLATFORM_ANDROID) + windowReady = true; // IMPORTANT! +#endif +} #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) // GLFW3 Error Callback, runs on GLFW3 error static void ErrorCallback(int error, const char *description) diff --git a/src/models.c b/src/models.c index 3749f8e5..3a4e38f1 100644 --- a/src/models.c +++ b/src/models.c @@ -836,7 +836,7 @@ Model LoadCubicmap(Image cubesmap) float w = mapCubeSide; float h = mapCubeSide; - float h2 = mapCubeSide * 1.5; + float h2 = mapCubeSide * 1.5; // TODO: Review walls height... Vector3 *mapVertices = (Vector3 *)malloc(maxTriangles * 3 * sizeof(Vector3)); Vector2 *mapTexcoords = (Vector2 *)malloc(maxTriangles * 3 * sizeof(Vector2)); diff --git a/src/raylib.h b/src/raylib.h index 4f199b90..c480802c 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -370,9 +370,10 @@ int GetMouseY(void); // Returns mouse positio Vector2 GetMousePosition(void); // Returns mouse position XY void SetMousePosition(Vector2 position); // Set mouse position XY int GetMouseWheelMove(void); // Returns mouse wheel movement Y -void ShowMouse(void); // Shows mouse cursor -void HideMouse(void); // Hides mouse cursor -bool IsMouseHidden(void); // Returns true if mouse cursor is not visible + +void ShowCursor(void); // Shows cursor +void HideCursor(void); // Hides cursor +bool IsCursorHidden(void); // Returns true if cursor is not visible #endif #if defined(PLATFORM_DESKTOP)