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. Using Qt with Gl3w
Forum Updated to NodeBB v4.3 + New Features

Using Qt with Gl3w

Scheduled Pinned Locked Moved Game Development
5 Posts 3 Posters 2.4k Views 3 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.
  • C Offline
    C Offline
    Colorfusion
    wrote on last edited by
    #1

    Hello,

    I'm having issues with integrating my qt project with gl3w, my plan was to build an external game editor for my game. I saw online that someone said that it is possible create the opengl context only from qt and use gl3w and normal opengl functions to render their scene. But when I included gl3w.h into my Qt project, there was a redefinition error as stated below:

    error C2371: 'PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC' : redefinition; different basic types

    Hope someone can help me with my issue. Thank you very much

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

      Hi and welcome to devnet,

      With Qt 5 you don't need Glew at all, you have everything needed there with e.g. QOpenGLFunctions

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

      C 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        With Qt 5 you don't need Glew at all, you have everything needed there with e.g. QOpenGLFunctions

        C Offline
        C Offline
        Colorfusion
        wrote on last edited by Colorfusion
        #3

        @SGaist My plan was to integrate my game engine within the editor so that I can use of some its functions when I'm building the game level. Is there any way around my issue? Or would be it preferable for me to use Qt's OpenGL classes instead?

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

          One thing you can try is to isolate your use of glew from your use of Qt

          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
          • Chris KawaC Offline
            Chris KawaC Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Make sure gl3w.h is included before any Qt OpenGL headers like QOpenGLWidget or whatever you're using.

            Here's a sample that you can try out that works for me. Should start an empty window and print GL version to debug output:

            #include "GL/gl3w.h"
            #include <QApplication>
            #include <QOpenGLWidget>
            #include <QDebug>
            
            struct MyGl : public QOpenGLWidget {
                MyGl() {}
                void initializeGL() {
                    gl3wInit();
                    qDebug() << (char*)gl3wGetString(GL_VERSION);
                }
            };
            
            int main(int argc, char *argv[]) {
                QApplication a(argc, argv);
                MyGl gl;
                gl.show();
                return a.exec();
            }
            
            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