2

I have been trying to draw elements using Qt5's QOpenGLFunctions and QOpenGLExtraFunctions classes, and I've had quite a few issues with argument types (but I will leave other issues out of this particular question). This question pertains to the use of glDrawElements, which is (see here) a "Convenience function that calls glDrawElements(mode, count, type, indices)." Indices in this case (from here):

Specifies a byte offset (cast to a pointer type) into the buffer bound to GL_ELEMENT_ARRAY_BUFFER to start reading indices from. If no buffer is bound, specifies a pointer to the location where the indices are stored.

In my case, I have no offset to the indices I want to access (0). I was under the belief that None would be Python's equivalent to a null pointer here, but I've so far only had success if I pass in shiboken2.shiboken2.VoidPtr(0), and I don't entirely understand why, nor how to (if at all possible) do this in a more "pythonic" way.

I am using Python3.8, PySide2, and OpenGL4.1 (core).

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
ades
  • 227
  • 2
  • 14

0 Answers0