Don't generate framebuffers with size 0.

Should fix #142
This commit is contained in:
IntegratedQuantum 2023-11-16 22:04:02 +01:00
parent bcf5ecf3c8
commit 4d25e9820b

View File

@ -1387,7 +1387,9 @@ pub const FrameBuffer = struct {
c.glDeleteTextures(1, &self.texture);
}
pub fn updateSize(self: *FrameBuffer, width: u31, height: u31, internalFormat: c_int) void {
pub fn updateSize(self: *FrameBuffer, _width: u31, _height: u31, internalFormat: c_int) void {
const width = @max(_width, 1);
const height = @max(_height, 1);
c.glBindFramebuffer(c.GL_FRAMEBUFFER, self.frameBuffer);
if(self.hasDepthTexture) {
c.glBindTexture(c.GL_TEXTURE_2D, self.depthTexture);