From 081fffd46e56ae1e6f80b12bf8fe5728828def22 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 19 Oct 2023 13:57:31 +0200 Subject: [PATCH] REVIEWED: Issue with functions definitions --- src/platforms/rcore_android.c | 5 +++-- src/platforms/rcore_desktop.c | 4 ++-- src/platforms/rcore_desktop_sdl.c | 5 +++-- src/platforms/rcore_drm.c | 4 ++-- src/platforms/rcore_template.c | 4 ++-- src/platforms/rcore_web.c | 5 +++-- src/rcore.c | 3 ++- 7 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/platforms/rcore_android.c b/src/platforms/rcore_android.c index ddf0c7a45..1272eecc3 100644 --- a/src/platforms/rcore_android.c +++ b/src/platforms/rcore_android.c @@ -516,7 +516,7 @@ void PollInputEvents(void) //---------------------------------------------------------------------------------- // Initialize platform: graphics, inputs and more -static int InitPlatform(void) +int InitPlatform(void) { CORE.Window.currentFbo.width = CORE.Window.screen.width; CORE.Window.currentFbo.height = CORE.Window.screen.height; @@ -589,7 +589,7 @@ static int InitPlatform(void) } // Close platform -static void ClosePlatform(void) +void ClosePlatform(void) { // Close surface, context and display if (platform.device != EGL_NO_DISPLAY) @@ -613,6 +613,7 @@ static void ClosePlatform(void) } } + // Initialize display device and framebuffer // NOTE: width and height represent the screen (framebuffer) desired size, not actual display size // If width or height are 0, default display size will be used for framebuffer size diff --git a/src/platforms/rcore_desktop.c b/src/platforms/rcore_desktop.c index 4dec2c77b..ea1b15fad 100644 --- a/src/platforms/rcore_desktop.c +++ b/src/platforms/rcore_desktop.c @@ -1214,7 +1214,7 @@ void PollInputEvents(void) //---------------------------------------------------------------------------------- // Initialize platform: graphics, inputs and more -static int InitPlatform(void) +int InitPlatform(void) { glfwSetErrorCallback(ErrorCallback); /* @@ -1531,7 +1531,7 @@ static int InitPlatform(void) } // Close platform -static void ClosePlatform(void) +void ClosePlatform(void) { glfwDestroyWindow(platform.handle); glfwTerminate(); diff --git a/src/platforms/rcore_desktop_sdl.c b/src/platforms/rcore_desktop_sdl.c index b64724334..c57a94fe9 100644 --- a/src/platforms/rcore_desktop_sdl.c +++ b/src/platforms/rcore_desktop_sdl.c @@ -1070,7 +1070,7 @@ void PollInputEvents(void) //---------------------------------------------------------------------------------- // Initialize platform: graphics, inputs and more -static int InitPlatform(void) +int InitPlatform(void) { // Initialize SDL internal global state int result = SDL_Init(SDL_INIT_EVERYTHING); @@ -1180,7 +1180,7 @@ static int InitPlatform(void) return 0; } -static void ClosePlatform(void) +void ClosePlatform(void) { SDL_FreeCursor(platform.cursor); // Free cursor SDL_GL_DeleteContext(platform.glContext); // Deinitialize OpenGL context @@ -1188,6 +1188,7 @@ static void ClosePlatform(void) SDL_Quit(); // Deinitialize SDL internal global state } + static KeyboardKey ConvertScancodeToKey(SDL_Scancode sdlScancode) { if (sdlScancode >= 0 && sdlScancode < SCANCODE_MAPPED_NUM) diff --git a/src/platforms/rcore_drm.c b/src/platforms/rcore_drm.c index 4df40e5b0..2ecfc2a3a 100644 --- a/src/platforms/rcore_drm.c +++ b/src/platforms/rcore_drm.c @@ -565,7 +565,7 @@ void PollInputEvents(void) //---------------------------------------------------------------------------------- // Initialize platform: graphics, inputs and more -static int InitPlatform(void) +int InitPlatform(void) { platform.fd = -1; platform.connector = NULL; @@ -916,7 +916,7 @@ static int InitPlatform(void) } // Close platform -static void ClosePlatform(void) +void ClosePlatform(void) { if (platform.prevFB) { diff --git a/src/platforms/rcore_template.c b/src/platforms/rcore_template.c index 87aca16da..dc71a66ca 100644 --- a/src/platforms/rcore_template.c +++ b/src/platforms/rcore_template.c @@ -429,7 +429,7 @@ void PollInputEvents(void) //---------------------------------------------------------------------------------- // Initialize platform: graphics, inputs and more -static int InitPlatform(void) +int InitPlatform(void) { CORE.Window.fullscreen = true; CORE.Window.flags |= FLAG_FULLSCREEN_MODE; @@ -556,7 +556,7 @@ static int InitPlatform(void) } // Close platform -static void ClosePlatform(void) +void ClosePlatform(void) { // TODO: De-initialize graphics, inputs and more } diff --git a/src/platforms/rcore_web.c b/src/platforms/rcore_web.c index bfc5bd790..e918e7d34 100644 --- a/src/platforms/rcore_web.c +++ b/src/platforms/rcore_web.c @@ -669,7 +669,7 @@ void PollInputEvents(void) //---------------------------------------------------------------------------------- // Initialize platform: graphics, inputs and more -static int InitPlatform(void) +int InitPlatform(void) { glfwSetErrorCallback(ErrorCallback); @@ -932,12 +932,13 @@ static int InitPlatform(void) } // Close platform -static void ClosePlatform(void) +void ClosePlatform(void) { glfwDestroyWindow(platform.handle); glfwTerminate(); } + // GLFW3 Error Callback, runs on GLFW3 error static void ErrorCallback(int error, const char *description) { diff --git a/src/rcore.c b/src/rcore.c index fd0335c6e..e3cd08188 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2523,7 +2523,8 @@ int GetTouchPointCount(void) //---------------------------------------------------------------------------------- // NOTE: Functions with a platform-specific implementation on rcore_.c -//static bool InitPlatform(void) +//int InitPlatform(void) +//void ClosePlatform(void) // Initialize hi-resolution timer void InitTimer(void)