c++ - glDrawArrays bad access -


I am trying to play a simple pong, but I am running on some issues. Basically, I have an array of four points with X-rays; Y value means to show the hardcode ball, and I need to display that ball properly. When I try to use glDrawArray, I will be crashing because I have four times the last parameter (to come in four corners). Why any thoughts?

In my setup:

  // put in the corner for the ball / numeral 1 ballpointer [0] = 0.1; // X ballPosArr [1] = 0.1; // y // pt 2 ballososar [2] = -0.1; Ballospace [3] = 0.1; // PT3 Ballospace [4] = 0.1; Ballospace [5] = -0.1; // pt4 ballososarr [6] = -0.1; Ballososar [7] = 0.1; // Ball Position buffer glutter buffer; Glanbuffers (1, and buffer); Glibind buffer (GL_ARRAY_BUFFER, buffer); GlobeFedata (GL_ARRAY_BUFFER, 8 * size (glut), ballposarr, glssaticidraav); _buffers.push_back (buffer); // _ buffers, gluent // has a vector of // Start the properties with the top shining glucipt BPO = glitch attribution (_per Program, "BollyPages"); glEnableVertexAttribArray (BPO); GlytaxAttrib Pointer (BPOS, 2, GL_Float, GL_Face, 0, and Ballsposer [0]);   

In my display callback:

  Gluiter BPOS = Glitch Attribution (_rash program, "Bolption"); glEnableVertexAttribArray (BPO); // Rebound buffers and send data again // ball position glBindBuffer (GL_ARRAY_BUFFER, _buffers [0]); GlytaxAttrib Pointer (BPOS, 2, GL_Float, GL_Face, 0, and Ballsposer [0]); Glaudrares (GL_POLYGON, 0, 4); / 4 / <>  

Bad access error in my vshader.txt:

  attribute vec2 ballPosition; Zero main () {}    

If you use VBOs, which you do , The last argument of glVertexAttribPointer is a relative offset in buffer, the buffer's CPU is not detected. In your case, pass 0 to the last logic, since you want to use the top data is at the beginning of the buffer.

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -