Skip to content

Commit bcaa38b

Browse files
committed
Pass key to van combo
1 parent 57b17e6 commit bcaa38b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

demosys/opengl/vao.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,12 @@ def map_buffer(self, vbo, attrib_name, components):
9999
:param components: Number of components (for example 3 for a x, y, x position)
100100
"""
101101
ab = self.array_buffer_map[id(vbo)]
102+
102103
# FIXME: Determine byte size based on data type in VBO
103104
offset = ab.stride
104105
ab.stride += components * 4
105106
am = ArrayMapping(ab, attrib_name, components, offset)
107+
106108
self.array_mapping.append(am)
107109
self.array_mapping_map[attrib_name] = am
108110

@@ -134,7 +136,7 @@ def generate_vao_combo(self, shader):
134136
return combo
135137

136138
print("Generating VAO Combo for {} using key {}".format(self.name, shader.attribute_key))
137-
combo = VAOCombo("moo")
139+
combo = VAOCombo(shader.attribute_key)
138140
combo.bind()
139141

140142
# Build the vao according to the shader's attribute specifications
@@ -159,6 +161,7 @@ def generate_vao_combo(self, shader):
159161

160162
mapping.array_buffer.vbo.bind()
161163
GL.glEnableVertexAttribArray(shader.attribute_list[i].location)
164+
162165
if mapping.array_buffer.format == GL.GL_FLOAT:
163166
GL.glVertexAttribPointer(shader.attribute_list[i].location,
164167
mapping.components,

demosys_test/cube/effect.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ def init(self):
2525
@effect.bind_target
2626
def draw(self, time, target):
2727
GL.glEnable(GL.GL_DEPTH_TEST)
28+
GL.glEnable(GL.GL_CULL_FACE)
29+
2830
self.fbo.bind()
2931

3032
mv_m = self.create_transformation(rotation=(time * 1.2, time * 2.1, time * 0.25),

0 commit comments

Comments
 (0)