Opengl problem



  • .h
    @#include<QGlWidget>
    #include <glwidget.h>

    class GlWidget : public QGLWidget
    {
    Q_OBJECT
    public:
    GlWidget(QWidget *parent = 0);
    ~GlWidget();
    protected:
    void initializeGL();
    void paintGL();
    void movePlayer(int,int,int);
    private:
    };@

    .cpp
    @#include "glwidget.h"

    GlWidget::GlWidget(QWidget parent)
    : QGLWidget(QGLFormat(/
    Additional format options */), parent)
    {
    }
    GlWidget::~GlWidget()
    {
    }

    void GlWidget::initializeGL()
    {
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_CULL_FACE);
    qglClearColor(QColor(Qt::white));
    glMatrixMode(GL_PROJECTION);

    }

    void GlWidget::paintGL()
    {
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    }
    @

    i get the following:
    GL_PROJECTION' was not declared in this scope
    glMatrixMode' was not declared in this scope

    and if i include <gl/gl.h> <gl/glu.h> i get conflict declaration


  • Lifetime Qt Champion

    Hi,

    You need to provide more information, what version of Qt ? What OS ? How did you install Qt ? If by package, which one did you use ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.