mirror of
https://github.com/raysan5/raylib.git
synced 2026-04-09 16:59:09 -04:00
Compare commits
3 Commits
6ef0044381
...
d3c6f426b4
| Author | SHA1 | Date | |
|---|---|---|---|
| d3c6f426b4 | |||
| c4bd4faab5 | |||
| 4a6ceb9c76 |
@ -202,8 +202,10 @@ fn compileRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.
|
||||
raylib.root_module.addCMacro("GRAPHICS_API_OPENGL_ES2", "");
|
||||
}
|
||||
|
||||
raylib.root_module.linkSystemLibrary("EGL", .{});
|
||||
raylib.root_module.linkSystemLibrary("gbm", .{});
|
||||
if (options.opengl_version != .gl_soft) {
|
||||
raylib.root_module.linkSystemLibrary("EGL", .{});
|
||||
raylib.root_module.linkSystemLibrary("gbm", .{});
|
||||
}
|
||||
raylib.root_module.linkSystemLibrary("libdrm", .{ .use_pkg_config = .force });
|
||||
|
||||
raylib.root_module.addCMacro("PLATFORM_DRM", "");
|
||||
@ -416,6 +418,7 @@ pub const Options = struct {
|
||||
|
||||
pub const OpenglVersion = enum {
|
||||
auto,
|
||||
gl_soft,
|
||||
gl_1_1,
|
||||
gl_2_1,
|
||||
gl_3_3,
|
||||
@ -426,6 +429,7 @@ pub const OpenglVersion = enum {
|
||||
pub fn toCMacroStr(self: @This()) []const u8 {
|
||||
switch (self) {
|
||||
.auto => @panic("OpenglVersion.auto cannot be turned into a C macro string"),
|
||||
.gl_soft => return "GRAPHICS_API_OPENGL_SOFTWARE",
|
||||
.gl_1_1 => return "GRAPHICS_API_OPENGL_11",
|
||||
.gl_2_1 => return "GRAPHICS_API_OPENGL_21",
|
||||
.gl_3_3 => return "GRAPHICS_API_OPENGL_33",
|
||||
|
||||
@ -96,21 +96,30 @@ elseif (${PLATFORM} STREQUAL "Android")
|
||||
|
||||
elseif ("${PLATFORM}" STREQUAL "DRM")
|
||||
set(PLATFORM_CPP "PLATFORM_DRM")
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||
|
||||
add_definitions(-D_DEFAULT_SOURCE)
|
||||
add_definitions(-DEGL_NO_X11)
|
||||
add_definitions(-DPLATFORM_DRM)
|
||||
|
||||
find_library(GLESV2 GLESv2)
|
||||
find_library(EGL EGL)
|
||||
find_library(DRM drm)
|
||||
find_library(GBM gbm)
|
||||
|
||||
if (NOT CMAKE_CROSSCOMPILING OR NOT CMAKE_SYSROOT)
|
||||
include_directories(/usr/include/libdrm)
|
||||
endif ()
|
||||
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread dl)
|
||||
|
||||
if ("${OPENGL_VERSION}" STREQUAL "Software")
|
||||
# software rendering does not require EGL/GBM.
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_SOFTWARE")
|
||||
set(LIBS_PRIVATE ${DRM} atomic pthread dl)
|
||||
else ()
|
||||
set(GRAPHICS "GRAPHICS_API_OPENGL_ES2")
|
||||
add_definitions(-DEGL_NO_X11)
|
||||
|
||||
find_library(GLESV2 GLESv2)
|
||||
find_library(EGL EGL)
|
||||
find_library(GBM gbm)
|
||||
|
||||
set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} atomic pthread dl)
|
||||
endif ()
|
||||
set(LIBS_PUBLIC m)
|
||||
|
||||
elseif ("${PLATFORM}" STREQUAL "SDL")
|
||||
|
||||
@ -723,7 +723,7 @@ void SetWindowIcon(Image image)
|
||||
TRACELOG(LOG_WARNING, "RGFW: Window icon image must be in R8G8B8A8 pixel format");
|
||||
return;
|
||||
}
|
||||
RGFW_window_setIcon(platform.window, (u8 *)image.data, image.width, image.height, 4);
|
||||
RGFW_window_setIcon(platform.window, (u8 *)image.data, image.width, image.height, RGFW_formatRGBA8);
|
||||
}
|
||||
|
||||
// Set icon for window
|
||||
@ -749,8 +749,8 @@ void SetWindowIcons(Image *images, int count)
|
||||
if ((smallIcon == NULL) || ((images[i].width < smallIcon->width) && (images[i].height > smallIcon->height))) smallIcon = &images[i];
|
||||
}
|
||||
|
||||
if (smallIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)smallIcon->data, smallIcon->width, smallIcon->height, 4, RGFW_iconWindow);
|
||||
if (bigIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)bigIcon->data, bigIcon->width, bigIcon->height, 4, RGFW_iconTaskbar);
|
||||
if (smallIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)smallIcon->data, smallIcon->width, smallIcon->height, RGFW_formatRGBA8, RGFW_iconWindow);
|
||||
if (bigIcon != NULL) RGFW_window_setIconEx(platform.window, (u8 *)bigIcon->data, bigIcon->width, bigIcon->height, RGFW_formatRGBA8, RGFW_iconTaskbar);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user