Commits

Leonard Ritter committed 44e343f

support for glDrawElements

Comments (0)

Files changed (1)

             GL_TYPE_ID_TO_TYPE[typeid],count))
     
 def glDrawBuffers(bufs):
-    print(bufs)
     _glDrawBuffers(len(bufs), _array('GLenum', bufs))
     
 def glShaderSource(shader, sources):
     _glVertexAttribPointer(index, size, typeid, normalized, stride, ptr)
     return ptr
 
+def glDrawElements(mode, typeid, data): 
+    if isinstance(data, int):
+        _glDrawElements(mode, data, typeid, _ffi.NULL)
+    else:
+        type_ = GL_TYPE_ID_TO_TYPE[typeid]
+        ptr = _array(type_, data)
+        _glDrawElements(mode, len(data), typeid, ptr)
+
 def glUniform1fv(location, values):
     _glUniform1fv(location, len(values), values)