OpenGL error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

OpenGL error

my GL.glDrawArrays(GL.GL_TRIANGLES,0,6) gives me an access violation error,before this I error get another error saying the third argument in the function has a wrong type,so I decided to explicitly write 6,instead of askimg the computer to calculate it. notes: 1)I am using python 2)I have post this question to opengl,python,gamedev forum with the name 'type error and access violation error',but the only answer I get is convert it to a unsigned integer,but error still occur

9th Nov 2017, 2:05 PM
Cheah Hsun Teik
Cheah Hsun Teik - avatar
4 Answers
0
my vertex buffer contains 6 vertices and I'm trying to draw 2 triangle side by side to form a rectangle.. my array with data: vertices=[-0.5,0.5,0, (top left corner) -0.5,-0.5,0, (bottom left corner) 0.5,-0.5,0,(bottom right corner) 0.5,-0.5,0,(bottom right corner) 0.5,0.5,0,(top right corner) -0.5,0.5,0](top left corner)
10th Nov 2017, 4:52 AM
Cheah Hsun Teik
Cheah Hsun Teik - avatar
0
Two of my python file: http://www.mediafire.com/file/8vfudfolkzgfqb5/Ballopia.py http://www.mediafire.com/file/peenhcfta6b8671/loader.py may be you could take a look and may be find and solve this error that have been around with me for quite a long time. thanks😅
13th Nov 2017, 3:29 AM
Cheah Hsun Teik
Cheah Hsun Teik - avatar
0
thanks.. but it looks like you replaced some of my code,such as GL.glGenVertexArrays(),GL.glGenBuffers(),GL.glBufferData() to something else entirely.. so, Is this what you called 'drawing everything in an 'old way' ',which is needed for my code to work? If not,why do you removed this code?
13th Nov 2017, 1:16 PM
Cheah Hsun Teik
Cheah Hsun Teik - avatar
0
Huh
15th Oct 2023, 6:21 AM
Mark Lawrence Guerra
Mark Lawrence Guerra - avatar