Skip to content

Commit 0cc293a

Browse files
committed
Less messy code in cube.py
1 parent 7f0e08c commit 0cc293a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

demosys/opengl/geometry/cube.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,19 @@ def cube(width, height, depth, normals=True, uvs=True):
133133
], dtype=numpy.float32))
134134

135135
vao = VAO("geometry:cube")
136+
# Add buffers
136137
vao.add_array_buffer(GL.GL_FLOAT, pos)
137138
if normals:
138139
vao.add_array_buffer(GL.GL_FLOAT, normals)
139140
if uvs:
140141
vao.add_array_buffer(GL.GL_FLOAT, uvs)
142+
143+
# Map buffers
141144
vao.map_buffer(pos, "in_position", 3)
142145
if normals:
143146
vao.map_buffer(normals, "in_normal", 3)
144147
if uvs:
145148
vao.map_buffer(uvs, "in_uv", 2)
149+
146150
vao.build()
147151
return vao

0 commit comments

Comments
 (0)