Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Error: 'QGLBuffer::IndexBuffer' is not a type

Error: 'QGLBuffer::IndexBuffer' is not a type

Scheduled Pinned Locked Moved Game Development
2 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Karunesh
    wrote on last edited by
    #1

    While creating a structure to hold information regarding an object, I am getting an unexpected error, something like

    @C:\K_QT\Learning\Minimal_Qt_OpenGL\minimal_example-build-desktop..\Qtopengl_minimal_example\glwindow.h:28: error: 'QGLBuffer::IndexBuffer' is not a type@

    The structure (in the file) looks like:

    @
    #ifndef GLWINDOW_H
    #define GLWINDOW_H

    #include <QGLWidget>
    #include <QTimer>
    #include <QtOpenGL/qglshaderprogram.h>
    #include <QtOpenGL>

    class GLWindow : public QGLWidget
    {
    Q_OBJECT
    public:
    GLWindow(QWidget *parent = 0);
    ~GLWindow();

    void resizeGL(int width, int height);
    void initializeGL();
    void paintGL();
    
    /////////////////////////////////////////////////////////////////////////////////////////////
    struct Drawable {
        QGLBuffer  vertexBuffer;
        QGLBuffer  indexBuffer(QGLBuffer::IndexBuffer); ///////////////// PROBLEM HERE
        int     faceCount;
        GLfloat transform[16];
    };
    /////////////////////////////////////////////////////////////////////////////////////////////
    
    struct Drawables
    {
        Drawable Truck;
        Drawable Cub01;
        Drawable Cube;
    };
    Drawable m_drawables;
    
    QMatrix4x4 truck;
    QMatrix4x4 cub01;
    QMatrix4x4 cube;
    
    void CreateDrawable(GLfloat* vertices,GLfloat* tex,GLfloat* normals,GLushort* face,int facecount,QMatrix4x4 &matrix);
    

    protected:
    QGLShaderProgram m_sampleProgram;
    };

    #endif // GLWINDOW_H
    @

    Initializing the vertexBuffer with 'QGLBuffer::VertexBuffer' leads to the same error, with both qglbuffer objects.

    Am I doing something wrong? (I am kind of clueless.)

    p.s. I am writing QT += opengl in my .pro file, and the project (though small) was compiling and running correctly until I decided to use buffers.

    Thanks and regards
    Karunesh

    1 Reply Last reply
    0
    • Z Offline
      Z Offline
      ZapB
      wrote on last edited by
      #2

      Try adding:

      @
      #include <QGLBuffer>
      @

      at the top of your file.

      Nokia Certified Qt Specialist
      Interested in hearing about Qt related work

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved