cleanup and flush gl lol
parent
b195b95585
commit
fb4b881def
|
|
@ -24,7 +24,6 @@ pub fn create() !*Camera {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resize(self: *Camera, width: i32, height: i32) void {
|
pub fn resize(self: *Camera, width: i32, height: i32) void {
|
||||||
std.debug.print("[Camera:resize] {d} x {d}\n", .{ width, height });
|
|
||||||
self.window_size_offset_x = @divFloor(width, 2);
|
self.window_size_offset_x = @divFloor(width, 2);
|
||||||
self.window_size_offset_y = @divFloor(height, 2);
|
self.window_size_offset_y = @divFloor(height, 2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ pub fn run() Error!void {
|
||||||
// setup for drawing
|
// setup for drawing
|
||||||
c.glClear(c.GL_COLOR_BUFFER_BIT | c.GL_DEPTH_BUFFER_BIT);
|
c.glClear(c.GL_COLOR_BUFFER_BIT | c.GL_DEPTH_BUFFER_BIT);
|
||||||
current_scene.?.draw();
|
current_scene.?.draw();
|
||||||
|
c.glFlush();
|
||||||
|
|
||||||
c.glfwSwapBuffers(window);
|
c.glfwSwapBuffers(window);
|
||||||
c.glfwPollEvents();
|
c.glfwPollEvents();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue