Skip to content

Commit b2c0379

Browse files
johanfforsbergikskuh
authored andcommitted
Generate texture mipmaps.
1 parent 40a0367 commit b2c0379

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

types.zig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,6 @@ pub const Texture = enum(UInt) {
123123

124124
pub const subImage2D = gl.textureSubImage2D;
125125
pub const subImage3D = gl.textureSubImage3D;
126+
127+
pub const generateMipmap = gl.generateTextureMipmap;
126128
};

zgl.zig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,6 +1375,11 @@ pub fn generateMipmap(target: TextureTarget) void {
13751375
checkError();
13761376
}
13771377

1378+
pub fn generateTextureMipmap(texture: types.Texture) void {
1379+
c.glGenerateTextureMipmap(@enumToInt(texture));
1380+
checkError();
1381+
}
1382+
13781383
pub fn bindTextureUnit(texture: types.Texture, unit: u32) void {
13791384
c.glBindTextureUnit(unit, @enumToInt(texture));
13801385
checkError();

0 commit comments

Comments
 (0)