Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: invalid operation after glUseProgram

  1. #11
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,527

    Re: invalid operation after glUseProgram

    >>and sizeof(vertexarray)=4. because vertexarray is a pointer.<<

    Ok, I was mislead on the array thing because of the new float[] allocation. Would still be fatal under 64-bit where the pointer size is 8 bytes.

  2. #12
    Junior Member Newbie
    Join Date
    Mar 2008
    Posts
    25

    Re: invalid operation after glUseProgram

    Thank you! I traced my program.
    float *VertexArray=new float[ 1310]
    glBufferData(GL_ARRAY_BUFFER, 5240,VertexArray, GL_STATIC_DRAW);
    glDrawArrays(GL_TRIANGLE_FAN,0,655)
    Maybe it's not because the length of arrays.
    I tried vertex at a time,still,when it came to glEnd ,invalid operation.I'm so confused. Maybe it's because of glcalllist above.

  3. #13
    Junior Member Newbie
    Join Date
    Mar 2008
    Posts
    25

    Re: invalid operation after glUseProgram

    I seemed to understand what's wrong,but I don't know how to solve the problem.I found my codes are in the display list, the display list is an invalid operation ,So whatever I draw would be wrong

  4. #14
    Junior Member Newbie
    Join Date
    Mar 2008
    Posts
    25

    Re: invalid operation after glUseProgram

    Thank you, Relic! Finally find my problem, before drawing something ,I should give the uniforms.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •