Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opengl problem
Qt 6.11 is out! See what's new in the release blog

Opengl problem

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.2k 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
    karim24
    wrote on last edited by
    #1

    .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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      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