This commit is contained in:
Jonathan Marler 2025-06-03 15:16:28 -04:00 committed by GitHub
commit bce5301105
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 2200 additions and 3 deletions

View file

@ -17,7 +17,8 @@ fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend
.rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""),
.sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""),
.android => raylib.root_module.addCMacro("PLATFORM_ANDROID", ""),
else => {},
.drm => {},
.win32 => raylib.root_module.addCMacro("PLATFORM_DESKTOP_WIN32", ""),
}
}
@ -180,11 +181,12 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
raylib.addIncludePath(b.path("src/platforms"));
switch (target.result.os.tag) {
.windows => {
try raylib_flags_arr.append("-DUNICODE");
switch (options.platform) {
.glfw => try c_source_files.append("src/rglfw.c"),
.rgfw, .sdl, .drm, .android => {},
.rgfw, .sdl, .drm, .android, .win32 => {},
}
raylib.linkSystemLibrary("shcore");
raylib.linkSystemLibrary("winmm");
raylib.linkSystemLibrary("gdi32");
raylib.linkSystemLibrary("opengl32");
@ -448,6 +450,7 @@ pub const PlatformBackend = enum {
sdl,
drm,
android,
win32,
};
pub fn build(b: *std.Build) !void {

View file

@ -342,6 +342,10 @@ ifeq ($(PLATFORM_OS), LINUX)
CFLAGS += -fPIC
endif
ifeq ($(PLATFORM_OS),WINDOWS)
CFLAGS += -DUNICODE
endif
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += -g -D_DEBUG
endif
@ -628,6 +632,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
LDLIBS += -latomic
endif
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
LDLIBS = -lgdi32 -lwinmm -lopengl32 -lshcore
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
endif

File diff suppressed because it is too large Load diff

View file

@ -553,6 +553,8 @@ const char *TextFormat(const char *text, ...); // Formatting of tex
#include "platforms/rcore_desktop_sdl.c"
#elif (defined(PLATFORM_DESKTOP_RGFW) || defined(PLATFORM_WEB_RGFW))
#include "platforms/rcore_desktop_rgfw.c"
#elif defined(PLATFORM_DESKTOP_WIN32)
#include "platforms/rcore_desktop_win32.c"
#elif defined(PLATFORM_WEB)
#include "platforms/rcore_web.c"
#elif defined(PLATFORM_DRM)
@ -622,6 +624,8 @@ void InitWindow(int width, int height, const char *title)
TRACELOG(LOG_INFO, "Platform backend: DESKTOP (SDL)");
#elif defined(PLATFORM_DESKTOP_RGFW)
TRACELOG(LOG_INFO, "Platform backend: DESKTOP (RGFW)");
#elif defined(PLATFORM_DESKTOP_WIN32)
TRACELOG(LOG_INFO, "Platform backend: DESKTOP (WIN32)");
#elif defined(PLATFORM_WEB_RGFW)
TRACELOG(LOG_INFO, "Platform backend: WEB (RGFW) (HTML5)");
#elif defined(PLATFORM_WEB)