Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: use VBO to define color & vertex variable in GPU

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    use VBO to define color & vertex variable in GPU

    I added this to the initialization part:
    Code :
    verticesSize = sizeof(vertices);
    colorsSize   = sizeof(colors);
    glGenBuffers(2, vbods);                       
    glBindBuffer(GL_ARRAY_BUFFER, vbods[VERTEX]); 
                 vertices, GL_STATIC_DRAW );
    glBufferSubData(GL_ARRAY_BUFFER, sizeof(vertices), sizeof(colors), colors);

    and this to the render part:
    Code :
    glBindBuffer(GL_ARRAY_BUFFER, vbods[VERTEX]);
    glVertexPointer(2, QVector3D, 0, 0);   
    glColorPointer(3, GL_FLOAT, 0, (GLvoid *) (ANGLE_COUNT * RANGE_COUNT * 6));

    though, I get errors in the functions glBufferData, It cannot cast it from QVector3D to GLvoid*, do you have any idea?

    vertices is defined as
    Last edited by saman_artorious; 06-22-2013 at 01:16 AM.

  2. #2
    solved the problem

Posting Permissions

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