Add submodules to Makefile and clean up some imports

This commit is contained in:
MichaelFiber 2023-09-13 17:13:53 -04:00
parent 205b9e171e
commit 7af660d6e6
3 changed files with 39 additions and 10 deletions

View File

@ -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

View File

@ -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 <stdlib.h> // Required for: srand(), rand(), atexit()
#include <stdio.h> // Required for: sprintf() [Used in OpenURL()]
#include <string.h> // Required for: strrchr(), strcmp(), strlen(), memset()
#include <time.h> // Required for: time() [Used in InitTimer()]
#include <math.h> // Required for: tan() [Used in BeginMode3D()], atan2f() [Used in LoadVrStereoConfig()]
#define _CRT_INTERNAL_NONSTDC_NAMES 1
#include <sys/stat.h> // Required for: stat(), S_ISREG [Used in GetFileModTime(), IsFilePath()]

View File

@ -1,6 +1,22 @@
#ifndef RCORE_H
#define RCORE_H
#include <stdlib.h> // Required for: srand(), rand(), atexit()
#include <stdio.h> // Required for: sprintf() [Used in OpenURL()]
#include <string.h> // Required for: strrchr(), strcmp(), strlen(), memset()
#include <time.h> // Required for: time() [Used in InitTimer()]
#include <math.h> // 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 {