Skip to content

Commit

Permalink
add RGFW platform support | fix minor bugs and errors (x86) for the R…
Browse files Browse the repository at this point in the history
…GFW platform, update RGFW platform license, update makefile info for RGFW platform
  • Loading branch information
ColleagueRiley committed May 6, 2024
1 parent fc8656e commit fe6c0c9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@

# Define required environment variables
#------------------------------------------------------------------------------------------------
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP_RGFW
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DESKTOP_SDL, PLATFORM_DESKTOP_RGFW, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP

# Define required raylib variables
PROJECT_NAME ?= raylib_examples
Expand Down
31 changes: 28 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
# Define required environment variables
#------------------------------------------------------------------------------------------------
# Define target platform: PLATFORM_DESKTOP, PLATFORM_DRM, PLATFORM_ANDROID, PLATFORM_WEB
PLATFORM ?= PLATFORM_DESKTOP_RGFW
PLATFORM ?= PLATFORM_DESKTOP

# Define required raylib variables
RAYLIB_VERSION = 5.0.0
Expand Down Expand Up @@ -119,7 +119,7 @@ HOST_PLATFORM_OS ?= WINDOWS
PLATFORM_OS ?= WINDOWS

# Determine PLATFORM_OS when required
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL PLATFORM_WEB PLATFORM_ANDROID))
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL PLATFORM_WEB PLATFORM_ANDROID PLATFORM_DESKTOP_RGFW))
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
# ifeq ($(UNAME),Msys) -> Windows
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -589,6 +589,31 @@ endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
endif
ifeq ($(PLATFORM),PLATFORM_DESKTOP_RGFW)
ifeq ($(PLATFORM_OS),WINDOWS)
# Libraries for Windows desktop compilation
LDLIBS = ..\src\libraylib.a -lgdi32 -lwinmm -lopengl32
endif
ifeq ($(PLATFORM_OS),LINUX)
# Libraries for Debian GNU/Linux desktop compipling
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = ../src/libraylib.a -lGL -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lm -lpthread -ldl -lrt

# Explicit link to libc
ifeq ($(RAYLIB_LIBTYPE),SHARED)
LDLIBS += -lc
endif

# NOTE: On ARM 32bit arch, miniaudio requires atomics library
LDLIBS += -latomic
endif
ifeq ($(PLATFORM_OS),OSX)
# Libraries for Debian GNU/Linux desktop compiling
# NOTE: Required packages: libegl1-mesa-dev
LDLIBS = ../src/libraylib.a -lm
LDLIBS += -framework Foundation -framework AppKit -framework OpenGL -framework CoreVideo
endif
endif

# Define source code object files required
#------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -633,7 +658,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
@echo "raylib library generated (lib$(RAYLIB_LIB_NAME).a)!"
else
ifeq ($(RAYLIB_LIBTYPE),SHARED)
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL))
ifeq ($(PLATFORM),$(filter $(PLATFORM),PLATFORM_DESKTOP PLATFORM_DESKTOP_SDL PLATFORM_DESKTOP_RGFW))
ifeq ($(PLATFORM_OS),WINDOWS)
# NOTE: Linking with provided resource file
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/$(RAYLIB_LIB_NAME).dll $(OBJS) $(RAYLIB_RES_FILE) $(LDFLAGS) $(LDLIBS)
Expand Down

0 comments on commit fe6c0c9

Please sign in to comment.