Merge branch 'raysan5:master' into master
This commit is contained in:
commit
b8fe0c47fa
20 changed files with 150 additions and 132 deletions
123
build.zig
123
build.zig
|
@ -179,7 +179,11 @@ 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 c_source_files.append("src/rglfw.c");
|
switch (options.platform) {
|
||||||
|
.glfw => try c_source_files.append("src/rglfw.c"),
|
||||||
|
.rgfw, .sdl, .drm => {},
|
||||||
|
}
|
||||||
|
|
||||||
raylib.linkSystemLibrary("winmm");
|
raylib.linkSystemLibrary("winmm");
|
||||||
raylib.linkSystemLibrary("gdi32");
|
raylib.linkSystemLibrary("gdi32");
|
||||||
raylib.linkSystemLibrary("opengl32");
|
raylib.linkSystemLibrary("opengl32");
|
||||||
|
@ -406,6 +410,16 @@ pub fn build(b: *std.Build) !void {
|
||||||
lib.installHeader(b.path("src/rlgl.h"), "rlgl.h");
|
lib.installHeader(b.path("src/rlgl.h"), "rlgl.h");
|
||||||
|
|
||||||
b.installArtifact(lib);
|
b.installArtifact(lib);
|
||||||
|
|
||||||
|
const examples = b.step("examples", "Build/Install all examples");
|
||||||
|
examples.dependOn(try addExamples("audio", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("core", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("models", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("others", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("shaders", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("shapes", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("text", b, target, optimize, lib));
|
||||||
|
examples.dependOn(try addExamples("textures", b, target, optimize, lib));
|
||||||
}
|
}
|
||||||
|
|
||||||
fn waylandGenerate(
|
fn waylandGenerate(
|
||||||
|
@ -430,3 +444,110 @@ fn waylandGenerate(
|
||||||
raylib.step.dependOn(&client_step.step);
|
raylib.step.dependOn(&client_step.step);
|
||||||
raylib.step.dependOn(&private_step.step);
|
raylib.step.dependOn(&private_step.step);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn addExamples(
|
||||||
|
comptime module: []const u8,
|
||||||
|
b: *std.Build,
|
||||||
|
target: std.Build.ResolvedTarget,
|
||||||
|
optimize: std.builtin.OptimizeMode,
|
||||||
|
raylib: *std.Build.Step.Compile,
|
||||||
|
) !*std.Build.Step {
|
||||||
|
if (target.result.os.tag == .emscripten) {
|
||||||
|
@panic("Emscripten building via Zig unsupported");
|
||||||
|
}
|
||||||
|
|
||||||
|
const all = b.step(module, "All " ++ module ++ " examples");
|
||||||
|
const module_subpath = b.pathJoin(&.{ "examples", module });
|
||||||
|
var dir = try std.fs.cwd().openDir(b.pathFromRoot(module_subpath), .{ .iterate = true });
|
||||||
|
defer if (comptime builtin.zig_version.minor >= 12) dir.close();
|
||||||
|
|
||||||
|
var iter = dir.iterate();
|
||||||
|
while (try iter.next()) |entry| {
|
||||||
|
if (entry.kind != .file) continue;
|
||||||
|
const extension_idx = std.mem.lastIndexOf(u8, entry.name, ".c") orelse continue;
|
||||||
|
const name = entry.name[0..extension_idx];
|
||||||
|
const path = b.pathJoin(&.{ module_subpath, entry.name });
|
||||||
|
|
||||||
|
// zig's mingw headers do not include pthread.h
|
||||||
|
if (std.mem.eql(u8, "core_loading_thread", name) and target.result.os.tag == .windows) continue;
|
||||||
|
|
||||||
|
const exe = b.addExecutable(.{
|
||||||
|
.name = name,
|
||||||
|
.target = target,
|
||||||
|
.optimize = optimize,
|
||||||
|
});
|
||||||
|
exe.addCSourceFile(.{ .file = b.path(path), .flags = &.{} });
|
||||||
|
exe.linkLibC();
|
||||||
|
|
||||||
|
// special examples that test using these external dependencies directly
|
||||||
|
// alongside raylib
|
||||||
|
if (std.mem.eql(u8, name, "rlgl_standalone")) {
|
||||||
|
exe.addIncludePath(b.path("src"));
|
||||||
|
exe.addIncludePath(b.path("src/external/glfw/include"));
|
||||||
|
if (!hasCSource(raylib.root_module, "rglfw.c")) {
|
||||||
|
exe.addCSourceFile(.{ .file = b.path("src/rglfw.c"), .flags = &.{} });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (std.mem.eql(u8, name, "raylib_opengl_interop")) {
|
||||||
|
exe.addIncludePath(b.path("src/external"));
|
||||||
|
}
|
||||||
|
|
||||||
|
exe.linkLibrary(raylib);
|
||||||
|
|
||||||
|
switch (target.result.os.tag) {
|
||||||
|
.windows => {
|
||||||
|
exe.linkSystemLibrary("winmm");
|
||||||
|
exe.linkSystemLibrary("gdi32");
|
||||||
|
exe.linkSystemLibrary("opengl32");
|
||||||
|
|
||||||
|
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
||||||
|
},
|
||||||
|
.linux => {
|
||||||
|
exe.linkSystemLibrary("GL");
|
||||||
|
exe.linkSystemLibrary("rt");
|
||||||
|
exe.linkSystemLibrary("dl");
|
||||||
|
exe.linkSystemLibrary("m");
|
||||||
|
exe.linkSystemLibrary("X11");
|
||||||
|
|
||||||
|
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
||||||
|
},
|
||||||
|
.macos => {
|
||||||
|
exe.linkFramework("Foundation");
|
||||||
|
exe.linkFramework("Cocoa");
|
||||||
|
exe.linkFramework("OpenGL");
|
||||||
|
exe.linkFramework("CoreAudio");
|
||||||
|
exe.linkFramework("CoreVideo");
|
||||||
|
exe.linkFramework("IOKit");
|
||||||
|
|
||||||
|
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
||||||
|
},
|
||||||
|
else => {
|
||||||
|
@panic("Unsupported OS");
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
const install_cmd = b.addInstallArtifact(exe, .{});
|
||||||
|
|
||||||
|
const run_cmd = b.addRunArtifact(exe);
|
||||||
|
run_cmd.cwd = b.path(module_subpath);
|
||||||
|
run_cmd.step.dependOn(&install_cmd.step);
|
||||||
|
|
||||||
|
const run_step = b.step(name, name);
|
||||||
|
run_step.dependOn(&run_cmd.step);
|
||||||
|
|
||||||
|
all.dependOn(&install_cmd.step);
|
||||||
|
}
|
||||||
|
return all;
|
||||||
|
}
|
||||||
|
|
||||||
|
fn hasCSource(module: *std.Build.Module, name: []const u8) bool {
|
||||||
|
for (module.link_objects.items) |o| switch (o) {
|
||||||
|
.c_source_file => |c| if (switch (c.file) {
|
||||||
|
.src_path => |s| std.ascii.endsWithIgnoreCase(s.sub_path, name),
|
||||||
|
.generated, .cwd_relative, .dependency => false,
|
||||||
|
}) return true,
|
||||||
|
.c_source_files => |s| for (s.files) |c| if (std.ascii.endsWithIgnoreCase(c, name)) return true,
|
||||||
|
else => {},
|
||||||
|
};
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -22,5 +22,6 @@
|
||||||
"build.zig",
|
"build.zig",
|
||||||
"build.zig.zon",
|
"build.zig.zon",
|
||||||
"src",
|
"src",
|
||||||
|
"examples",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,110 +0,0 @@
|
||||||
const std = @import("std");
|
|
||||||
const builtin = @import("builtin");
|
|
||||||
|
|
||||||
// This has been tested to work with zig 0.12.0
|
|
||||||
fn add_module(comptime module: []const u8, b: *std.Build, target: std.Build.ResolvedTarget, optimize: std.builtin.OptimizeMode) !*std.Build.Step {
|
|
||||||
if (target.result.os.tag == .emscripten) {
|
|
||||||
@panic("Emscripten building via Zig unsupported");
|
|
||||||
}
|
|
||||||
|
|
||||||
const all = b.step(module, "All " ++ module ++ " examples");
|
|
||||||
var dir = try std.fs.cwd().openDir(module, .{ .iterate = true });
|
|
||||||
defer if (comptime builtin.zig_version.minor >= 12) dir.close();
|
|
||||||
|
|
||||||
var iter = dir.iterate();
|
|
||||||
while (try iter.next()) |entry| {
|
|
||||||
if (entry.kind != .file) continue;
|
|
||||||
const extension_idx = std.mem.lastIndexOf(u8, entry.name, ".c") orelse continue;
|
|
||||||
const name = entry.name[0..extension_idx];
|
|
||||||
const path = try std.fs.path.join(b.allocator, &.{ module, entry.name });
|
|
||||||
|
|
||||||
// zig's mingw headers do not include pthread.h
|
|
||||||
if (std.mem.eql(u8, "core_loading_thread", name) and target.result.os.tag == .windows) continue;
|
|
||||||
|
|
||||||
const exe = b.addExecutable(.{
|
|
||||||
.name = name,
|
|
||||||
.target = target,
|
|
||||||
.optimize = optimize,
|
|
||||||
});
|
|
||||||
exe.addCSourceFile(.{ .file = b.path(path), .flags = &.{} });
|
|
||||||
exe.linkLibC();
|
|
||||||
exe.addObjectFile(switch (target.result.os.tag) {
|
|
||||||
.windows => b.path("../zig-out/lib/raylib.lib"),
|
|
||||||
.linux => b.path("../zig-out/lib/libraylib.a"),
|
|
||||||
.macos => b.path("../zig-out/lib/libraylib.a"),
|
|
||||||
.emscripten => b.path("../zig-out/lib/libraylib.a"),
|
|
||||||
else => @panic("Unsupported OS"),
|
|
||||||
});
|
|
||||||
|
|
||||||
exe.addIncludePath(b.path("../src"));
|
|
||||||
exe.addIncludePath(b.path("../src/external"));
|
|
||||||
exe.addIncludePath(b.path("../src/external/glfw/include"));
|
|
||||||
|
|
||||||
switch (target.result.os.tag) {
|
|
||||||
.windows => {
|
|
||||||
exe.linkSystemLibrary("winmm");
|
|
||||||
exe.linkSystemLibrary("gdi32");
|
|
||||||
exe.linkSystemLibrary("opengl32");
|
|
||||||
|
|
||||||
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
|
||||||
},
|
|
||||||
.linux => {
|
|
||||||
exe.linkSystemLibrary("GL");
|
|
||||||
exe.linkSystemLibrary("rt");
|
|
||||||
exe.linkSystemLibrary("dl");
|
|
||||||
exe.linkSystemLibrary("m");
|
|
||||||
exe.linkSystemLibrary("X11");
|
|
||||||
|
|
||||||
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
|
||||||
},
|
|
||||||
.macos => {
|
|
||||||
exe.linkFramework("Foundation");
|
|
||||||
exe.linkFramework("Cocoa");
|
|
||||||
exe.linkFramework("OpenGL");
|
|
||||||
exe.linkFramework("CoreAudio");
|
|
||||||
exe.linkFramework("CoreVideo");
|
|
||||||
exe.linkFramework("IOKit");
|
|
||||||
|
|
||||||
exe.root_module.addCMacro("PLATFORM_DESKTOP", "");
|
|
||||||
},
|
|
||||||
else => {
|
|
||||||
@panic("Unsupported OS");
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const install_cmd = b.addInstallArtifact(exe, .{});
|
|
||||||
|
|
||||||
const run_cmd = b.addRunArtifact(exe);
|
|
||||||
run_cmd.cwd = b.path(module);
|
|
||||||
run_cmd.step.dependOn(&install_cmd.step);
|
|
||||||
|
|
||||||
const run_step = b.step(name, name);
|
|
||||||
run_step.dependOn(&run_cmd.step);
|
|
||||||
|
|
||||||
all.dependOn(&install_cmd.step);
|
|
||||||
}
|
|
||||||
return all;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
|
||||||
// Standard target options allows the person running `zig build` to choose
|
|
||||||
// what target to build for. Here we do not override the defaults, which
|
|
||||||
// means any target is allowed, and the default is native. Other options
|
|
||||||
// for restricting supported target set are available.
|
|
||||||
const target = b.standardTargetOptions(.{});
|
|
||||||
// Standard optimization options allow the person running `zig build` to select
|
|
||||||
// between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
|
|
||||||
// set a preferred release mode, allowing the user to decide how to optimize.
|
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
|
||||||
|
|
||||||
const all = b.getInstallStep();
|
|
||||||
|
|
||||||
all.dependOn(try add_module("audio", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("core", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("models", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("others", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("shaders", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("shapes", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("text", b, target, optimize));
|
|
||||||
all.dependOn(try add_module("textures", b, target, optimize));
|
|
||||||
}
|
|
|
@ -95,7 +95,10 @@ int main(void)
|
||||||
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
|
DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY);
|
||||||
DrawText("PRESS UP | DOWN to CHANGE TARGET FPS", 10, GetScreenHeight() - 30, 20, GRAY);
|
DrawText("PRESS UP | DOWN to CHANGE TARGET FPS", 10, GetScreenHeight() - 30, 20, GRAY);
|
||||||
DrawText(TextFormat("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME);
|
DrawText(TextFormat("TARGET FPS: %i", targetFPS), GetScreenWidth() - 220, 10, 20, LIME);
|
||||||
|
if (deltaTime != 0)
|
||||||
|
{
|
||||||
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
|
DrawText(TextFormat("CURRENT FPS: %i", (int)(1.0f/deltaTime)), GetScreenWidth() - 220, 40, 20, GREEN);
|
||||||
|
}
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ int main(void)
|
||||||
|
|
||||||
int framesCounter = 0;
|
int framesCounter = 0;
|
||||||
|
|
||||||
//SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//----------------------------------------------------------
|
//----------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
|
@ -97,7 +97,10 @@ int main(void)
|
||||||
if (IsWindowState(FLAG_WINDOW_MINIMIZED))
|
if (IsWindowState(FLAG_WINDOW_MINIMIZED))
|
||||||
{
|
{
|
||||||
framesCounter++;
|
framesCounter++;
|
||||||
if (framesCounter >= 240) RestoreWindow(); // Restore window after 3 seconds
|
if (framesCounter >= 240) {
|
||||||
|
RestoreWindow(); // Restore window after 3 seconds
|
||||||
|
framesCounter = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsKeyPressed(KEY_M))
|
if (IsKeyPressed(KEY_M))
|
||||||
|
@ -163,9 +166,9 @@ int main(void)
|
||||||
if (IsWindowState(FLAG_WINDOW_UNDECORATED)) DrawText("[D] FLAG_WINDOW_UNDECORATED: on", 10, 120, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_UNDECORATED)) DrawText("[D] FLAG_WINDOW_UNDECORATED: on", 10, 120, 10, LIME);
|
||||||
else DrawText("[D] FLAG_WINDOW_UNDECORATED: off", 10, 120, 10, MAROON);
|
else DrawText("[D] FLAG_WINDOW_UNDECORATED: off", 10, 120, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_HIDDEN)) DrawText("[H] FLAG_WINDOW_HIDDEN: on", 10, 140, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_HIDDEN)) DrawText("[H] FLAG_WINDOW_HIDDEN: on", 10, 140, 10, LIME);
|
||||||
else DrawText("[H] FLAG_WINDOW_HIDDEN: off", 10, 140, 10, MAROON);
|
else DrawText("[H] FLAG_WINDOW_HIDDEN: off (hides for 3 seconds)", 10, 140, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_MINIMIZED)) DrawText("[N] FLAG_WINDOW_MINIMIZED: on", 10, 160, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_MINIMIZED)) DrawText("[N] FLAG_WINDOW_MINIMIZED: on", 10, 160, 10, LIME);
|
||||||
else DrawText("[N] FLAG_WINDOW_MINIMIZED: off", 10, 160, 10, MAROON);
|
else DrawText("[N] FLAG_WINDOW_MINIMIZED: off (restores after 3 seconds)", 10, 160, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_MAXIMIZED)) DrawText("[M] FLAG_WINDOW_MAXIMIZED: on", 10, 180, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_MAXIMIZED)) DrawText("[M] FLAG_WINDOW_MAXIMIZED: on", 10, 180, 10, LIME);
|
||||||
else DrawText("[M] FLAG_WINDOW_MAXIMIZED: off", 10, 180, 10, MAROON);
|
else DrawText("[M] FLAG_WINDOW_MAXIMIZED: off", 10, 180, 10, MAROON);
|
||||||
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) DrawText("[G] FLAG_WINDOW_UNFOCUSED: on", 10, 200, 10, LIME);
|
if (IsWindowState(FLAG_WINDOW_UNFOCUSED)) DrawText("[G] FLAG_WINDOW_UNFOCUSED: on", 10, 200, 10, LIME);
|
||||||
|
|
|
@ -3280,7 +3280,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "RestoreWindow",
|
"name": "RestoreWindow",
|
||||||
"description": "Set window state: not minimized/maximized",
|
"description": "Restore window from being minimized/maximized",
|
||||||
"returnType": "void"
|
"returnType": "void"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -3223,7 +3223,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = "RestoreWindow",
|
name = "RestoreWindow",
|
||||||
description = "Set window state: not minimized/maximized",
|
description = "Restore window from being minimized/maximized",
|
||||||
returnType = "void"
|
returnType = "void"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ Function 017: MinimizeWindow() (0 input parameters)
|
||||||
Function 018: RestoreWindow() (0 input parameters)
|
Function 018: RestoreWindow() (0 input parameters)
|
||||||
Name: RestoreWindow
|
Name: RestoreWindow
|
||||||
Return type: void
|
Return type: void
|
||||||
Description: Set window state: not minimized/maximized
|
Description: Restore window from being minimized/maximized
|
||||||
No input parameters
|
No input parameters
|
||||||
Function 019: SetWindowIcon() (1 input parameters)
|
Function 019: SetWindowIcon() (1 input parameters)
|
||||||
Name: SetWindowIcon
|
Name: SetWindowIcon
|
||||||
|
|
|
@ -720,7 +720,7 @@
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="MinimizeWindow" retType="void" paramCount="0" desc="Set window state: minimized, if resizable">
|
<Function name="MinimizeWindow" retType="void" paramCount="0" desc="Set window state: minimized, if resizable">
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="RestoreWindow" retType="void" paramCount="0" desc="Set window state: not minimized/maximized">
|
<Function name="RestoreWindow" retType="void" paramCount="0" desc="Restore window from being minimized/maximized">
|
||||||
</Function>
|
</Function>
|
||||||
<Function name="SetWindowIcon" retType="void" paramCount="1" desc="Set icon for window (single image, RGBA 32bit)">
|
<Function name="SetWindowIcon" retType="void" paramCount="1" desc="Set icon for window (single image, RGBA 32bit)">
|
||||||
<Param type="Image" name="image" desc="" />
|
<Param type="Image" name="image" desc="" />
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
<Overload retVal="void" descr="Set window state: minimized, if resizable"></Overload>
|
<Overload retVal="void" descr="Set window state: minimized, if resizable"></Overload>
|
||||||
</KeyWord>
|
</KeyWord>
|
||||||
<KeyWord name="RestoreWindow" func="yes">
|
<KeyWord name="RestoreWindow" func="yes">
|
||||||
<Overload retVal="void" descr="Set window state: not minimized/maximized"></Overload>
|
<Overload retVal="void" descr="Restore window from being minimized/maximized"></Overload>
|
||||||
</KeyWord>
|
</KeyWord>
|
||||||
<KeyWord name="SetWindowIcon" func="yes">
|
<KeyWord name="SetWindowIcon" func="yes">
|
||||||
<Overload retVal="void" descr="Set icon for window (single image, RGBA 32bit)">
|
<Overload retVal="void" descr="Set icon for window (single image, RGBA 32bit)">
|
||||||
|
|
|
@ -20,7 +20,7 @@ RLAPI void ToggleFullscreen(void); // Toggle wind
|
||||||
RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution
|
RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution
|
||||||
RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable
|
RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable
|
||||||
RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable
|
RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable
|
||||||
RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized
|
RLAPI void RestoreWindow(void); // Restore window from being minimized/maximized
|
||||||
RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit)
|
RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit)
|
||||||
RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit)
|
RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit)
|
||||||
RLAPI void SetWindowTitle(const char *title); // Set title for window
|
RLAPI void SetWindowTitle(const char *title); // Set title for window
|
||||||
|
|
|
@ -337,7 +337,7 @@ void MinimizeWindow(void)
|
||||||
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window state: not minimized/maximized
|
// Restore window from being minimized/maximized
|
||||||
void RestoreWindow(void)
|
void RestoreWindow(void)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "RestoreWindow() not available on target platform");
|
TRACELOG(LOG_WARNING, "RestoreWindow() not available on target platform");
|
||||||
|
|
|
@ -292,7 +292,7 @@ void MinimizeWindow(void)
|
||||||
glfwIconifyWindow(platform.handle);
|
glfwIconifyWindow(platform.handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window state: not minimized/maximized
|
// Restore window from being minimized/maximized
|
||||||
void RestoreWindow(void)
|
void RestoreWindow(void)
|
||||||
{
|
{
|
||||||
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE)
|
if (glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE)
|
||||||
|
|
|
@ -339,7 +339,7 @@ void MinimizeWindow(void)
|
||||||
RGFW_window_minimize(platform.window);
|
RGFW_window_minimize(platform.window);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window state: not minimized/maximized
|
// Restore window from being minimized/maximized
|
||||||
void RestoreWindow(void)
|
void RestoreWindow(void)
|
||||||
{
|
{
|
||||||
if (!(CORE.Window.flags & FLAG_WINDOW_UNFOCUSED)) RGFW_window_focus(platform.window);
|
if (!(CORE.Window.flags & FLAG_WINDOW_UNFOCUSED)) RGFW_window_focus(platform.window);
|
||||||
|
|
|
@ -508,7 +508,7 @@ void MinimizeWindow(void)
|
||||||
if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) == 0) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED;
|
if ((CORE.Window.flags & FLAG_WINDOW_MINIMIZED) == 0) CORE.Window.flags |= FLAG_WINDOW_MINIMIZED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window state: not minimized/maximized
|
// Restore window from being minimized/maximized
|
||||||
void RestoreWindow(void)
|
void RestoreWindow(void)
|
||||||
{
|
{
|
||||||
SDL_RestoreWindow(platform.window);
|
SDL_RestoreWindow(platform.window);
|
||||||
|
@ -1670,7 +1670,7 @@ void PollInputEvents(void)
|
||||||
{
|
{
|
||||||
int jid = event.jdevice.which; // Joystick device index
|
int jid = event.jdevice.which; // Joystick device index
|
||||||
|
|
||||||
if (!CORE.Input.Gamepad.ready[jid] && (jid < MAX_GAMEPADS))
|
if (CORE.Input.Gamepad.ready[jid] && (jid < MAX_GAMEPADS))
|
||||||
{
|
{
|
||||||
platform.gamepad[jid] = SDL_GameControllerOpen(jid);
|
platform.gamepad[jid] = SDL_GameControllerOpen(jid);
|
||||||
platform.gamepadId[jid] = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(platform.gamepad[jid]));
|
platform.gamepadId[jid] = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(platform.gamepad[jid]));
|
||||||
|
|
|
@ -277,7 +277,7 @@ void MinimizeWindow(void)
|
||||||
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window state: not minimized/maximized
|
// Restore window from being minimized/maximized
|
||||||
void RestoreWindow(void)
|
void RestoreWindow(void)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "RestoreWindow() not available on target platform");
|
TRACELOG(LOG_WARNING, "RestoreWindow() not available on target platform");
|
||||||
|
|
|
@ -114,7 +114,7 @@ void MinimizeWindow(void)
|
||||||
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window state: not minimized/maximized
|
// Restore window from being minimized/maximized
|
||||||
void RestoreWindow(void)
|
void RestoreWindow(void)
|
||||||
{
|
{
|
||||||
TRACELOG(LOG_WARNING, "RestoreWindow() not available on target platform");
|
TRACELOG(LOG_WARNING, "RestoreWindow() not available on target platform");
|
||||||
|
|
|
@ -350,7 +350,7 @@ void MinimizeWindow(void)
|
||||||
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
TRACELOG(LOG_WARNING, "MinimizeWindow() not available on target platform");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set window state: not minimized/maximized
|
// Restore window from being minimized/maximized
|
||||||
void RestoreWindow(void)
|
void RestoreWindow(void)
|
||||||
{
|
{
|
||||||
if ((glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE) && (CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
|
if ((glfwGetWindowAttrib(platform.handle, GLFW_RESIZABLE) == GLFW_TRUE) && (CORE.Window.flags & FLAG_WINDOW_MAXIMIZED))
|
||||||
|
|
|
@ -987,7 +987,7 @@ RLAPI void ToggleFullscreen(void); // Toggle wind
|
||||||
RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution
|
RLAPI void ToggleBorderlessWindowed(void); // Toggle window state: borderless windowed, resizes window to match monitor resolution
|
||||||
RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable
|
RLAPI void MaximizeWindow(void); // Set window state: maximized, if resizable
|
||||||
RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable
|
RLAPI void MinimizeWindow(void); // Set window state: minimized, if resizable
|
||||||
RLAPI void RestoreWindow(void); // Set window state: not minimized/maximized
|
RLAPI void RestoreWindow(void); // Restore window from being minimized/maximized
|
||||||
RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit)
|
RLAPI void SetWindowIcon(Image image); // Set icon for window (single image, RGBA 32bit)
|
||||||
RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit)
|
RLAPI void SetWindowIcons(Image *images, int count); // Set icon for window (multiple images, RGBA 32bit)
|
||||||
RLAPI void SetWindowTitle(const char *title); // Set title for window
|
RLAPI void SetWindowTitle(const char *title); // Set title for window
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue