Skip to content

Commit

Permalink
Merge branch 'raysan5:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley authored Jun 29, 2024
2 parents 642222c + c1ea326 commit b1604c2
Show file tree
Hide file tree
Showing 6 changed files with 863 additions and 915 deletions.
5 changes: 2 additions & 3 deletions examples/models/models_skybox.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ int main(void)
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
Model skybox = LoadModelFromMesh(cube);

bool useHDR = true;
// Set this to true to use an HDR Texture, Note that raylib must be built with HDR Support for this to work SUPPORT_FILEFORMAT_HDR
bool useHDR = false;

// Load skybox shader and set required locations
// NOTE: Some locations are automatically set at shader loading
Expand Down Expand Up @@ -157,8 +158,6 @@ int main(void)
DrawGrid(10, 1.0f);

EndMode3D();

//DrawTextureEx(panorama, (Vector2){ 0, 0 }, 0.0f, 0.5f, WHITE);

if (useHDR) DrawText(TextFormat("Panorama image from hdrihaven.com: %s", GetFileName(skyboxFileName)), 10, GetScreenHeight() - 20, 10, BLACK);
else DrawText(TextFormat(": %s", GetFileName(skyboxFileName)), 10, GetScreenHeight() - 20, 10, BLACK);
Expand Down
18 changes: 11 additions & 7 deletions src/build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ comptime {
// get the flags a second time when adding raygui
var raylib_flags_arr: std.ArrayListUnmanaged([]const u8) = .{};

/// we're not inside the actual build script recognized by the
/// zig build system; use this type where one would otherwise
/// use `@This()` when inside the actual entrypoint file.
const BuildScript = @import("../build.zig");

// This has been tested with zig version 0.12.0
pub fn addRaylib(b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode, options: Options) !*std.Build.Step.Compile {
const raylib_dep = b.dependency(options.raylib_dependency_name, .{
const raylib_dep = b.dependencyFromBuildZig(BuildScript, .{
.target = target,
.optimize = optimize,
.raudio = options.raudio,
Expand Down Expand Up @@ -257,7 +262,6 @@ pub const Options = struct {
linux_display_backend: LinuxDisplayBackend = .X11,
opengl_version: OpenglVersion = .auto,

raylib_dependency_name: []const u8 = "raylib",
raygui_dependency_name: []const u8 = "raygui",
};

Expand All @@ -272,11 +276,11 @@ 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_1_1 => return "GRAPHICS_API_OPENGL_11",
.gl_2_1 => return "GRAPHICS_API_OPENGL_21",
.gl_3_3 => return "GRAPHICS_API_OPENGL_33",
.gl_4_3 => return "GRAPHICS_API_OPENGL_43",
.auto => @panic("OpenglVersion.auto cannot be turned into a C macro string"),
.gl_1_1 => return "GRAPHICS_API_OPENGL_11",
.gl_2_1 => return "GRAPHICS_API_OPENGL_21",
.gl_3_3 => return "GRAPHICS_API_OPENGL_33",
.gl_4_3 => return "GRAPHICS_API_OPENGL_43",
.gles_2 => return "GRAPHICS_API_OPENGL_ES2",
.gles_3 => return "GRAPHICS_API_OPENGL_ES3",
}
Expand Down
Loading

0 comments on commit b1604c2

Please sign in to comment.