From 08fc886afd88907516dc7519ac7542fa30e5f369 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 14 Dec 2017 11:40:08 +0100 Subject: added proper define checks for png-save if it's disabled --- src/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index ec7db978..d4646268 100644 --- a/src/core.c +++ b/src/core.c @@ -1134,7 +1134,7 @@ void SetConfigFlags(char flags) // Takes a screenshot of current screen (saved a .png) void TakeScreenshot(const char *fileName) { -#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) +#if (defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI)) && defined(SUPPORT_SAVE_PNG) unsigned char *imgData = rlReadScreenPixels(renderWidth, renderHeight); SavePNG(fileName, imgData, renderWidth, renderHeight, 4); // Save image as PNG free(imgData); -- cgit v1.2.3 From a7f2fedbfbfde92e7c12c21b108a2b99965bc28d Mon Sep 17 00:00:00 2001 From: user Date: Thu, 14 Dec 2017 11:45:47 +0100 Subject: compilefix for function declaration (win only) --- src/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index d4646268..882aadcd 100644 --- a/src/core.c +++ b/src/core.c @@ -153,8 +153,9 @@ //#define GLFW_DLL // Using GLFW DLL on Windows -> No, we use static version! #if !defined(SUPPORT_BUSY_WAIT_LOOP) && defined(_WIN32) - __stdcall unsigned int timeBeginPeriod(unsigned int uPeriod); - __stdcall unsigned int timeEndPeriod(unsigned int uPeriod); + // NOTE: Those functions require linking with winmm library + unsigned int __stdcall timeBeginPeriod(unsigned int uPeriod); + unsigned int __stdcall timeEndPeriod(unsigned int uPeriod); #endif #endif -- cgit v1.2.3 From 48d0c93ace63225231d56f6a7aaa058218622578 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 14 Dec 2017 11:50:35 +0100 Subject: make GetTime available to user of library --- src/core.c | 4 ++-- src/raylib.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index 882aadcd..011e0d76 100644 --- a/src/core.c +++ b/src/core.c @@ -352,7 +352,7 @@ extern void UnloadDefaultFont(void); // [Module: text] Unloads default fo static void InitGraphicsDevice(int width, int height); // Initialize graphics device static void SetupFramebufferSize(int displayWidth, int displayHeight); static void InitTimer(void); // Initialize timer -static double GetTime(void); // Returns time since InitTimer() was run + double GetTime(void); // Returns time since InitTimer() was run static void Wait(float ms); // Wait for some milliseconds (stop program execution) static bool GetKeyStatus(int key); // Returns if a key has been pressed static bool GetMouseButtonStatus(int button); // Returns if a mouse button has been pressed @@ -2120,7 +2120,7 @@ static void InitTimer(void) } // Get current time measure (in seconds) since InitTimer() -static double GetTime(void) +double GetTime(void) { #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB) return glfwGetTime(); diff --git a/src/raylib.h b/src/raylib.h index 9af21872..0a9eab46 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -723,6 +723,9 @@ RLAPI void SetTargetFPS(int fps); // Set target RLAPI int GetFPS(void); // Returns current FPS RLAPI float GetFrameTime(void); // Returns time in seconds for last frame drawn +RLAPI double GetTime(void); // Return time in seconds + + // Color-related functions RLAPI int GetHexValue(Color color); // Returns hexadecimal value for a Color RLAPI Color GetColor(int hexValue); // Returns a Color struct from hexadecimal value -- cgit v1.2.3 From 2affac820e64393ac4294c53c1a7f47742e8dec9 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 14 Dec 2017 11:52:45 +0100 Subject: make raylib not clash with windows-header --- src/core.c | 10 +++++----- src/raylib.h | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index 011e0d76..8e26d2b1 100644 --- a/src/core.c +++ b/src/core.c @@ -413,7 +413,7 @@ static void *GamepadThread(void *arg); // Mouse reading thread #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) // Initialize window and OpenGL context // NOTE: data parameter could be used to pass any kind of required data to the initialization -void InitWindow(int width, int height, void *data) +void InitRLWindow(int width, int height, void *data) { TraceLog(LOG_INFO, "Initializing raylib (v1.9-dev)"); @@ -477,7 +477,7 @@ void InitWindow(int width, int height, void *data) #if defined(PLATFORM_ANDROID) // Initialize window and OpenGL context (and Android activity) // NOTE: data parameter could be used to pass any kind of required data to the initialization -void InitWindow(int width, int height, void *data) +void InitRLWindow(int width, int height, void *data) { TraceLog(LOG_INFO, "Initializing raylib (v1.9-dev)"); @@ -538,7 +538,7 @@ void InitWindow(int width, int height, void *data) #endif // Close window and unload OpenGL context -void CloseWindow(void) +void CloseRLWindow(void) { #if defined(SUPPORT_GIF_RECORDING) if (gifRecording) @@ -715,7 +715,7 @@ int GetScreenHeight(void) } // Show mouse cursor -void ShowCursor() +void ShowRLCursor() { #if defined(PLATFORM_DESKTOP) #if defined(__linux__) @@ -728,7 +728,7 @@ void ShowCursor() } // Hides mouse cursor -void HideCursor() +void HideRLCursor() { #if defined(PLATFORM_DESKTOP) #if defined(__linux__) diff --git a/src/raylib.h b/src/raylib.h index 0a9eab46..16595b5b 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -682,8 +682,8 @@ extern "C" { // Prevents name mangling of functions //------------------------------------------------------------------------------------ // Window-related functions -RLAPI void InitWindow(int width, int height, void *data); // Initialize window and OpenGL context -RLAPI void CloseWindow(void); // Close window and unload OpenGL context +RLAPI void InitRLWindow(int width, int height, void *data); // Initialize window and OpenGL context +RLAPI void CloseRLWindow(void); // Close window and unload OpenGL context RLAPI bool WindowShouldClose(void); // Check if KEY_ESCAPE pressed or Close icon pressed RLAPI bool IsWindowMinimized(void); // Check if window has been minimized (or lost focus) RLAPI void ToggleFullscreen(void); // Toggle fullscreen mode (only PLATFORM_DESKTOP) @@ -696,8 +696,8 @@ RLAPI int GetScreenWidth(void); // Get current RLAPI int GetScreenHeight(void); // Get current screen height // Cursor-related functions -RLAPI void ShowCursor(void); // Shows cursor -RLAPI void HideCursor(void); // Hides cursor +RLAPI void ShowRLCursor(void); // Shows cursor +RLAPI void HideRLCursor(void); // Hides cursor RLAPI bool IsCursorHidden(void); // Check if cursor is not visible RLAPI void EnableCursor(void); // Enables cursor (unlock cursor) RLAPI void DisableCursor(void); // Disables cursor (lock cursor) -- cgit v1.2.3