Skip to content

Commit

Permalink
minor code cleanup in mrt.zig
Browse files Browse the repository at this point in the history
  • Loading branch information
floooh committed Feb 19, 2024
1 parent d0d8610 commit fde7ac3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/examples/mrt.zig
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export fn init() void {
};

// setup the offscreen render pass resources this will also be called when the window resizes
createOffscreenPass(sapp.width(), sapp.height());
createOffscreenAttachments(sapp.width(), sapp.height());

// create vertex buffer for a cube
const cube_vbuf = sg.makeBuffer(.{
Expand Down Expand Up @@ -234,7 +234,7 @@ export fn cleanup() void {

export fn event(ev: [*c]const sapp.Event) void {
if (ev.*.type == .RESIZED) {
createOffscreenPass(ev.*.framebuffer_width, ev.*.framebuffer_height);
createOffscreenAttachments(ev.*.framebuffer_width, ev.*.framebuffer_height);
}
}

Expand Down Expand Up @@ -264,7 +264,7 @@ fn computeMVP(rx: f32, ry: f32) mat4 {
}

// helper function to create or re-create render target images and pass object for offscreen rendering
fn createOffscreenPass(width: i32, height: i32) void {
fn createOffscreenAttachments(width: i32, height: i32) void {
// destroy previous resources (can be called with invalid ids)
sg.destroyAttachments(state.offscreen.attachments);
for (state.offscreen.attachments_desc.colors) |att| {
Expand Down

0 comments on commit fde7ac3

Please sign in to comment.