Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
What am I doing wrong?
-
I am working on OpenGLES bindings for pythonista and I keep having argument errors appear.
Here is the function raising the errorglShaderSource(GLuint(shader), GLsizei(1), str(source), GLint(0))
How it is setup
GLint = ctypes.c_int32 GLuint = ctypes.c_uint32 GLsizei = ctypes.c_int32 glShaderSource = c.glShaderSource glShaderSource.restype = None glShaderSource.argtypes = [GLuint, GLsizei, ctypes.c_char_p, GLint]
Which throws
ArgumentError: argument 3: <'type.exceptions.TypeError'>: wrong type
Where am I going wrong? -
void glShaderSource( GLuint shader, GLsizei count, const GLchar **string, const GLint *length);
it appears that GLchar needs to be an array of string pointers.
So maybe something like (c_char_p * NumStrings) fir the argtype, and
mystrarray=(ctypes.c_char_p*NumStrings)() mystrarray[0]=source
-
That fixed the issue, thanks you @JonB