Python Forum

Full Version: type error and access violation error pyopengl
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

GL.glDrawArrays(GL.GL_TRIANGLES,0,model1.vertexcou nt)
gives me an error saying:
ctypes.ArgumentError:argument 3:<class 'TypeError'>: wrong type
which i interpret as:
the 3rd argument given to this function/method is in the wrong type
so,i search on the internet for what type they want for the third argument ,it says:
it wants GLsizei type,which is a non-negative binary integer.
After that,i checked the model1.vertexcount's type by doing print(type(model1.vertexcount)) using python,it prints <class 'float'>
I tried to change it to integer by doing int(model1.vertexcount),but it gives me an error:
OSError:exception:access violation reading 0x0A56BAA8
I also tried to input the value 6 myself,instead of letting the raw model class do the job,but it still output an Error:
OSError:exception:access violation reading 0x0CD5DD98

Notes:
1)The hexadecimal number at the back part of the error differ in every run.
2)i am learning opengl from Thin Matrix.
3)i am using numpy to create the arrays
4)If more information is needed,ask below in the reply....

Hope anyone can help me
Thanks.....[Image: smile.png]