From 7af660d6e62763a68ac8e6bc89c4c26bd952b45e Mon Sep 17 00:00:00 2001 From: MichaelFiber Date: Wed, 13 Sep 2023 17:13:53 -0400 Subject: [PATCH] Add submodules to Makefile and clean up some imports --- src/Makefile | 15 +++++++++++++-- src/rcore.c | 8 -------- src/rcore.h | 26 ++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/src/Makefile b/src/Makefile index 63cbe2a41..58c520369 100644 --- a/src/Makefile +++ b/src/Makefile @@ -632,8 +632,19 @@ endif # Compile all modules with their prerequisites # Compile core module -rcore.o : rcore.c raylib.h rlgl.h utils.h raymath.h rcamera.h rgestures.h - $(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) +RCORE_SUBMODULE=rcore_desktop.c +ifeq ($(PLATFORM),PLATFORM_ANDROID) + RCORE_SUBMODULE=rcore_android.c +endif +ifeq ($(PLATFORM),PLATFORM_DRM) + RCORE_SUBMODULE=rcore_drm.c +endif +ifeq ($(PLATFORM),PLATFORM_WEB) + RCORE_SUBMODULE=rcore_web.c +endif + +rcore.o : rcore.c raylib.h rlgl.h utils.h raymath.h rcamera.h rgestures.h rcore.h + $(CC) -c $< $(RCORE_SUBMODULE) $(CFLAGS) $(INCLUDE_PATHS) # Compile rglfw module rglfw.o : rglfw.c diff --git a/src/rcore.c b/src/rcore.c index 05a0853ad..0c4a4b451 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -106,8 +106,6 @@ #include "config.h" // Defines module configuration flags #endif -#include "utils.h" // Required for: TRACELOG() macros - #define RLGL_IMPLEMENTATION #include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2 @@ -167,12 +165,6 @@ #endif // OSs #endif // PLATFORM_DESKTOP -#include // Required for: srand(), rand(), atexit() -#include // Required for: sprintf() [Used in OpenURL()] -#include // Required for: strrchr(), strcmp(), strlen(), memset() -#include // Required for: time() [Used in InitTimer()] -#include // Required for: tan() [Used in BeginMode3D()], atan2f() [Used in LoadVrStereoConfig()] - #define _CRT_INTERNAL_NONSTDC_NAMES 1 #include // Required for: stat(), S_ISREG [Used in GetFileModTime(), IsFilePath()] diff --git a/src/rcore.h b/src/rcore.h index cd1d31154..acea1c579 100644 --- a/src/rcore.h +++ b/src/rcore.h @@ -1,6 +1,22 @@ #ifndef RCORE_H #define RCORE_H +#include // Required for: srand(), rand(), atexit() +#include // Required for: sprintf() [Used in OpenURL()] +#include // Required for: strrchr(), strcmp(), strlen(), memset() +#include // Required for: time() [Used in InitTimer()] +#include // Required for: tan() [Used in BeginMode3D()], atan2f() [Used in LoadVrStereoConfig()] + +#include "utils.h" // Required for: TRACELOG() macros + +#if defined(PLATFORM_DESKTOP) + #define GLFW_INCLUDE_NONE // Disable the standard OpenGL header inclusion on GLFW3 + // NOTE: Already provided by rlgl implementation (on glad.h) + #include "GLFW/glfw3.h" // GLFW3 library: Windows, OpenGL context and Input management + // NOTE: GLFW3 already includes gl.h (OpenGL) headers +#endif + + // PROVIDE A HEADER TO BE USED BY ALL THE rcore_* IMPLEMENTATIONS. /* @@ -117,6 +133,16 @@ typedef struct CoreData { char **dropFilepaths; // Store dropped files paths pointers (provided by GLFW) unsigned int dropFileCount; // Count dropped files strings + struct { + float width; + float height; + } windowMin; + + struct { + float width; + float height; + } windowMax; + } Window; #if defined(PLATFORM_ANDROID) struct {