Merge d0929734d7
into 5f497d0687
This commit is contained in:
commit
bce5301105
4 changed files with 2200 additions and 3 deletions
|
@ -17,7 +17,8 @@ fn setDesktopPlatform(raylib: *std.Build.Step.Compile, platform: PlatformBackend
|
||||||
.rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""),
|
.rgfw => raylib.root_module.addCMacro("PLATFORM_DESKTOP_RGFW", ""),
|
||||||
.sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""),
|
.sdl => raylib.root_module.addCMacro("PLATFORM_DESKTOP_SDL", ""),
|
||||||
.android => raylib.root_module.addCMacro("PLATFORM_ANDROID", ""),
|
.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"));
|
raylib.addIncludePath(b.path("src/platforms"));
|
||||||
switch (target.result.os.tag) {
|
switch (target.result.os.tag) {
|
||||||
.windows => {
|
.windows => {
|
||||||
|
try raylib_flags_arr.append("-DUNICODE");
|
||||||
switch (options.platform) {
|
switch (options.platform) {
|
||||||
.glfw => try c_source_files.append("src/rglfw.c"),
|
.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("winmm");
|
||||||
raylib.linkSystemLibrary("gdi32");
|
raylib.linkSystemLibrary("gdi32");
|
||||||
raylib.linkSystemLibrary("opengl32");
|
raylib.linkSystemLibrary("opengl32");
|
||||||
|
@ -448,6 +450,7 @@ pub const PlatformBackend = enum {
|
||||||
sdl,
|
sdl,
|
||||||
drm,
|
drm,
|
||||||
android,
|
android,
|
||||||
|
win32,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
pub fn build(b: *std.Build) !void {
|
||||||
|
|
|
@ -342,6 +342,10 @@ ifeq ($(PLATFORM_OS), LINUX)
|
||||||
CFLAGS += -fPIC
|
CFLAGS += -fPIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
|
CFLAGS += -DUNICODE
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
|
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -g -D_DEBUG
|
CFLAGS += -g -D_DEBUG
|
||||||
endif
|
endif
|
||||||
|
@ -628,6 +632,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||||
LDLIBS += -latomic
|
LDLIBS += -latomic
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32)
|
||||||
|
LDLIBS = -lgdi32 -lwinmm -lopengl32 -lshcore
|
||||||
|
endif
|
||||||
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||||
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
|
LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm
|
||||||
endif
|
endif
|
||||||
|
|
2183
src/platforms/rcore_desktop_win32.c
Normal file
2183
src/platforms/rcore_desktop_win32.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -553,6 +553,8 @@ const char *TextFormat(const char *text, ...); // Formatting of tex
|
||||||
#include "platforms/rcore_desktop_sdl.c"
|
#include "platforms/rcore_desktop_sdl.c"
|
||||||
#elif (defined(PLATFORM_DESKTOP_RGFW) || defined(PLATFORM_WEB_RGFW))
|
#elif (defined(PLATFORM_DESKTOP_RGFW) || defined(PLATFORM_WEB_RGFW))
|
||||||
#include "platforms/rcore_desktop_rgfw.c"
|
#include "platforms/rcore_desktop_rgfw.c"
|
||||||
|
#elif defined(PLATFORM_DESKTOP_WIN32)
|
||||||
|
#include "platforms/rcore_desktop_win32.c"
|
||||||
#elif defined(PLATFORM_WEB)
|
#elif defined(PLATFORM_WEB)
|
||||||
#include "platforms/rcore_web.c"
|
#include "platforms/rcore_web.c"
|
||||||
#elif defined(PLATFORM_DRM)
|
#elif defined(PLATFORM_DRM)
|
||||||
|
@ -622,6 +624,8 @@ void InitWindow(int width, int height, const char *title)
|
||||||
TRACELOG(LOG_INFO, "Platform backend: DESKTOP (SDL)");
|
TRACELOG(LOG_INFO, "Platform backend: DESKTOP (SDL)");
|
||||||
#elif defined(PLATFORM_DESKTOP_RGFW)
|
#elif defined(PLATFORM_DESKTOP_RGFW)
|
||||||
TRACELOG(LOG_INFO, "Platform backend: 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)
|
#elif defined(PLATFORM_WEB_RGFW)
|
||||||
TRACELOG(LOG_INFO, "Platform backend: WEB (RGFW) (HTML5)");
|
TRACELOG(LOG_INFO, "Platform backend: WEB (RGFW) (HTML5)");
|
||||||
#elif defined(PLATFORM_WEB)
|
#elif defined(PLATFORM_WEB)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue