mirror of
https://github.com/Not-Nik/raylib-zig.git
synced 2025-09-09 12:07:27 +00:00
Compare commits
No commits in common. "731884848a1c5480ee58f38d5b787c501925cbe2" and "a6e9ce520f056200bc8aaecb6ca3c35ffe84cccd" have entirely different histories.
731884848a
...
a6e9ce520f
@ -1,7 +1,4 @@
|
|||||||
> Development of raylib-zig has moved to [its own organisation](https://github.com/raylib-zig/raylib-zig).
|

|
||||||
> Please update your `build.zig.zon` files and other links accordingly.
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
# raylib-zig
|
# raylib-zig
|
||||||
|
|
||||||
@ -9,7 +6,7 @@ Manually tweaked, auto-generated [raylib](https://github.com/raysan5/raylib) bin
|
|||||||
|
|
||||||
Bindings tested on raylib version 5.6-dev and Zig 0.14.0
|
Bindings tested on raylib version 5.6-dev and Zig 0.14.0
|
||||||
|
|
||||||
Thanks to all the [contributors](https://github.com/raylib-zig/raylib-zig/graphs/contributors) for their help with this
|
Thanks to all the [contributors](https://github.com/Not-Nik/raylib-zig/graphs/contributors) for their help with this
|
||||||
binding.
|
binding.
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
@ -67,7 +64,7 @@ want to run an example, say `basic_window` run `zig build basic_window`
|
|||||||
Download and add raylib-zig as a dependency by running the following command in your project root:
|
Download and add raylib-zig as a dependency by running the following command in your project root:
|
||||||
|
|
||||||
```
|
```
|
||||||
zig fetch --save git+https://github.com/raylib-zig/raylib-zig#devel
|
zig fetch --save git+https://github.com/Not-Nik/raylib-zig#devel
|
||||||
```
|
```
|
||||||
|
|
||||||
Then add raylib-zig as a dependency and import its modules and artifact in your `build.zig`:
|
Then add raylib-zig as a dependency and import its modules and artifact in your `build.zig`:
|
||||||
|
@ -71,12 +71,6 @@ const gui = struct {
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub fn build(b: *std.Build) !void {
|
pub fn build(b: *std.Build) !void {
|
||||||
const stdout = std.io.getStdOut().writer();
|
|
||||||
try stdout.print(
|
|
||||||
\\Development of raylib-zig has moved to its own organisation (https://github.com/raylib-zig/raylib-zig).
|
|
||||||
\\Please update your `build.zig.zon` files and other links accordingly.
|
|
||||||
\\
|
|
||||||
, .{});
|
|
||||||
const target = b.standardTargetOptions(.{});
|
const target = b.standardTargetOptions(.{});
|
||||||
const optimize = b.standardOptimizeOption(.{});
|
const optimize = b.standardOptimizeOption(.{});
|
||||||
|
|
||||||
|
@ -1411,11 +1411,6 @@ pub const Mesh = extern struct {
|
|||||||
pub fn drawInstanced(self: Mesh, material: Material, transforms: []const Matrix) void {
|
pub fn drawInstanced(self: Mesh, material: Material, transforms: []const Matrix) void {
|
||||||
rl.drawMeshInstanced(self, material, transforms);
|
rl.drawMeshInstanced(self, material, transforms);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unload mesh data from CPU and GPU
|
|
||||||
pub fn unload(self: Mesh) void {
|
|
||||||
rl.unloadMesh(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Shader = extern struct {
|
pub const Shader = extern struct {
|
||||||
@ -1431,11 +1426,6 @@ pub const Shader = extern struct {
|
|||||||
pub fn deactivate(_: Shader) void {
|
pub fn deactivate(_: Shader) void {
|
||||||
rl.endShaderMode();
|
rl.endShaderMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unload shader from GPU memory (VRAM)
|
|
||||||
pub fn unload(self: Shader) void {
|
|
||||||
rl.unloadShader(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const MaterialMap = extern struct {
|
pub const MaterialMap = extern struct {
|
||||||
@ -1448,11 +1438,6 @@ pub const Material = extern struct {
|
|||||||
shader: Shader,
|
shader: Shader,
|
||||||
maps: [*c]MaterialMap,
|
maps: [*c]MaterialMap,
|
||||||
params: [4]f32,
|
params: [4]f32,
|
||||||
|
|
||||||
/// Unload material from GPU memory (VRAM)
|
|
||||||
pub fn unload(self: Material) void {
|
|
||||||
rl.unloadMaterial(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Transform = extern struct {
|
pub const Transform = extern struct {
|
||||||
@ -1519,11 +1504,6 @@ pub const ModelAnimation = extern struct {
|
|||||||
bones: [*c]BoneInfo,
|
bones: [*c]BoneInfo,
|
||||||
framePoses: [*c][*c]Transform,
|
framePoses: [*c][*c]Transform,
|
||||||
name: [32]u8,
|
name: [32]u8,
|
||||||
|
|
||||||
/// Unload animation data
|
|
||||||
pub fn unload(self: ModelAnimation) void {
|
|
||||||
rl.unloadModelAnimation(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Ray = extern struct {
|
pub const Ray = extern struct {
|
||||||
@ -1549,11 +1529,6 @@ pub const Wave = extern struct {
|
|||||||
sampleSize: c_uint,
|
sampleSize: c_uint,
|
||||||
channels: c_uint,
|
channels: c_uint,
|
||||||
data: *anyopaque,
|
data: *anyopaque,
|
||||||
|
|
||||||
/// Unload wave data
|
|
||||||
pub fn unload(self: Wave) void {
|
|
||||||
rl.unloadWave(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const rAudioBuffer = opaque {};
|
pub const rAudioBuffer = opaque {};
|
||||||
@ -1565,21 +1540,11 @@ pub const AudioStream = extern struct {
|
|||||||
sampleRate: c_uint,
|
sampleRate: c_uint,
|
||||||
sampleSize: c_uint,
|
sampleSize: c_uint,
|
||||||
channels: c_uint,
|
channels: c_uint,
|
||||||
|
|
||||||
/// Unload audio stream and free memory
|
|
||||||
pub fn unload(self: AudioStream) void {
|
|
||||||
rl.unloadAudioStream(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Sound = extern struct {
|
pub const Sound = extern struct {
|
||||||
stream: AudioStream,
|
stream: AudioStream,
|
||||||
frameCount: c_uint,
|
frameCount: c_uint,
|
||||||
|
|
||||||
/// Unload sound
|
|
||||||
pub fn unload(self: Sound) void {
|
|
||||||
rl.unloadSound(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Music = extern struct {
|
pub const Music = extern struct {
|
||||||
@ -1588,11 +1553,6 @@ pub const Music = extern struct {
|
|||||||
looping: bool,
|
looping: bool,
|
||||||
ctxType: c_int,
|
ctxType: c_int,
|
||||||
ctxData: *anyopaque,
|
ctxData: *anyopaque,
|
||||||
|
|
||||||
/// Unload music stream
|
|
||||||
pub fn unload(self: Music) void {
|
|
||||||
rl.unloadMusicStream(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const VrDeviceInfo = extern struct {
|
pub const VrDeviceInfo = extern struct {
|
||||||
@ -1617,11 +1577,6 @@ pub const VrStereoConfig = extern struct {
|
|||||||
rightScreenCenter: [2]f32,
|
rightScreenCenter: [2]f32,
|
||||||
scale: [2]f32,
|
scale: [2]f32,
|
||||||
scaleIn: [2]f32,
|
scaleIn: [2]f32,
|
||||||
|
|
||||||
/// Unload VR stereo config
|
|
||||||
pub fn unload(self: VrStereoConfig) void {
|
|
||||||
rl.unloadVrStereoConfig(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const FilePathList = extern struct {
|
pub const FilePathList = extern struct {
|
||||||
@ -1636,16 +1591,7 @@ pub const AutomationEvent = extern struct {
|
|||||||
params: [4]c_int,
|
params: [4]c_int,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const AutomationEventList = extern struct {
|
pub const AutomationEventList = extern struct { capacity: c_uint, count: c_uint, events: [*c]AutomationEvent };
|
||||||
capacity: c_uint,
|
|
||||||
count: c_uint,
|
|
||||||
events: [*c]AutomationEvent,
|
|
||||||
|
|
||||||
/// Unload automation events list from file
|
|
||||||
pub fn unload(self: AutomationEventList) void {
|
|
||||||
rl.unloadAutomationEventList(self);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
pub const ConfigFlags = packed struct {
|
pub const ConfigFlags = packed struct {
|
||||||
__reserved: bool = false,
|
__reserved: bool = false,
|
||||||
|
@ -1411,11 +1411,6 @@ pub const Mesh = extern struct {
|
|||||||
pub fn drawInstanced(self: Mesh, material: Material, transforms: []const Matrix) void {
|
pub fn drawInstanced(self: Mesh, material: Material, transforms: []const Matrix) void {
|
||||||
rl.drawMeshInstanced(self, material, transforms);
|
rl.drawMeshInstanced(self, material, transforms);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unload mesh data from CPU and GPU
|
|
||||||
pub fn unload(self: Mesh) void {
|
|
||||||
rl.unloadMesh(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Shader = extern struct {
|
pub const Shader = extern struct {
|
||||||
@ -1431,11 +1426,6 @@ pub const Shader = extern struct {
|
|||||||
pub fn deactivate(_: Shader) void {
|
pub fn deactivate(_: Shader) void {
|
||||||
rl.endShaderMode();
|
rl.endShaderMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Unload shader from GPU memory (VRAM)
|
|
||||||
pub fn unload(self: Shader) void {
|
|
||||||
rl.unloadShader(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const MaterialMap = extern struct {
|
pub const MaterialMap = extern struct {
|
||||||
@ -1448,11 +1438,6 @@ pub const Material = extern struct {
|
|||||||
shader: Shader,
|
shader: Shader,
|
||||||
maps: [*c]MaterialMap,
|
maps: [*c]MaterialMap,
|
||||||
params: [4]f32,
|
params: [4]f32,
|
||||||
|
|
||||||
/// Unload material from GPU memory (VRAM)
|
|
||||||
pub fn unload(self: Material) void {
|
|
||||||
rl.unloadMaterial(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Transform = extern struct {
|
pub const Transform = extern struct {
|
||||||
@ -1519,11 +1504,6 @@ pub const ModelAnimation = extern struct {
|
|||||||
bones: [*c]BoneInfo,
|
bones: [*c]BoneInfo,
|
||||||
framePoses: [*c][*c]Transform,
|
framePoses: [*c][*c]Transform,
|
||||||
name: [32]u8,
|
name: [32]u8,
|
||||||
|
|
||||||
/// Unload animation data
|
|
||||||
pub fn unload(self: ModelAnimation) void {
|
|
||||||
rl.unloadModelAnimation(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Ray = extern struct {
|
pub const Ray = extern struct {
|
||||||
@ -1549,11 +1529,6 @@ pub const Wave = extern struct {
|
|||||||
sampleSize: c_uint,
|
sampleSize: c_uint,
|
||||||
channels: c_uint,
|
channels: c_uint,
|
||||||
data: *anyopaque,
|
data: *anyopaque,
|
||||||
|
|
||||||
/// Unload wave data
|
|
||||||
pub fn unload(self: Wave) void {
|
|
||||||
rl.unloadWave(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const rAudioBuffer = opaque {};
|
pub const rAudioBuffer = opaque {};
|
||||||
@ -1565,21 +1540,11 @@ pub const AudioStream = extern struct {
|
|||||||
sampleRate: c_uint,
|
sampleRate: c_uint,
|
||||||
sampleSize: c_uint,
|
sampleSize: c_uint,
|
||||||
channels: c_uint,
|
channels: c_uint,
|
||||||
|
|
||||||
/// Unload audio stream and free memory
|
|
||||||
pub fn unload(self: AudioStream) void {
|
|
||||||
rl.unloadAudioStream(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Sound = extern struct {
|
pub const Sound = extern struct {
|
||||||
stream: AudioStream,
|
stream: AudioStream,
|
||||||
frameCount: c_uint,
|
frameCount: c_uint,
|
||||||
|
|
||||||
/// Unload sound
|
|
||||||
pub fn unload(self: Sound) void {
|
|
||||||
rl.unloadSound(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const Music = extern struct {
|
pub const Music = extern struct {
|
||||||
@ -1588,11 +1553,6 @@ pub const Music = extern struct {
|
|||||||
looping: bool,
|
looping: bool,
|
||||||
ctxType: c_int,
|
ctxType: c_int,
|
||||||
ctxData: *anyopaque,
|
ctxData: *anyopaque,
|
||||||
|
|
||||||
/// Unload music stream
|
|
||||||
pub fn unload(self: Music) void {
|
|
||||||
rl.unloadMusicStream(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const VrDeviceInfo = extern struct {
|
pub const VrDeviceInfo = extern struct {
|
||||||
@ -1617,11 +1577,6 @@ pub const VrStereoConfig = extern struct {
|
|||||||
rightScreenCenter: [2]f32,
|
rightScreenCenter: [2]f32,
|
||||||
scale: [2]f32,
|
scale: [2]f32,
|
||||||
scaleIn: [2]f32,
|
scaleIn: [2]f32,
|
||||||
|
|
||||||
/// Unload VR stereo config
|
|
||||||
pub fn unload(self: VrStereoConfig) void {
|
|
||||||
rl.unloadVrStereoConfig(self);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const FilePathList = extern struct {
|
pub const FilePathList = extern struct {
|
||||||
@ -1636,16 +1591,7 @@ pub const AutomationEvent = extern struct {
|
|||||||
params: [4]c_int,
|
params: [4]c_int,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const AutomationEventList = extern struct {
|
pub const AutomationEventList = extern struct { capacity: c_uint, count: c_uint, events: [*c]AutomationEvent };
|
||||||
capacity: c_uint,
|
|
||||||
count: c_uint,
|
|
||||||
events: [*c]AutomationEvent,
|
|
||||||
|
|
||||||
/// Unload automation events list from file
|
|
||||||
pub fn unload(self: AutomationEventList) void {
|
|
||||||
rl.unloadAutomationEventList(self);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
pub const ConfigFlags = packed struct {
|
pub const ConfigFlags = packed struct {
|
||||||
__reserved: bool = false,
|
__reserved: bool = false,
|
||||||
|
@ -65,7 +65,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
|
|
||||||
New-Item -Name "build.zig" -ItemType "file" -Value $BUILD_DOT_ZIG -Force
|
New-Item -Name "build.zig" -ItemType "file" -Value $BUILD_DOT_ZIG -Force
|
||||||
|
|
||||||
zig fetch --save git+https://github.com/raylib-zig/raylib-zig#devel
|
zig fetch --save git+https://github.com/Not-Nik/raylib-zig#devel
|
||||||
|
|
||||||
New-Item -Name "resources" -ItemType "directory"
|
New-Item -Name "resources" -ItemType "directory"
|
||||||
New-Item -Name "resources/placeholder.txt" -ItemType "file" -Value "" -Force
|
New-Item -Name "resources/placeholder.txt" -ItemType "file" -Value "" -Force
|
||||||
|
@ -63,7 +63,7 @@ pub fn build(b: *std.Build) !void {
|
|||||||
b.installArtifact(exe);
|
b.installArtifact(exe);
|
||||||
}' >> build.zig
|
}' >> build.zig
|
||||||
|
|
||||||
zig fetch --save git+https://github.com/raylib-zig/raylib-zig#devel
|
zig fetch --save git+https://github.com/Not-Nik/raylib-zig#devel
|
||||||
|
|
||||||
mkdir resources
|
mkdir resources
|
||||||
touch resources/placeholder.txt
|
touch resources/placeholder.txt
|
||||||
|
Loading…
x
Reference in New Issue
Block a user