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 10 Oct 2015, 16:53 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
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 10 Oct 2015, 20:02 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 11 Oct 2015, 03:35
      0
      • S SGaist
        10 Oct 2015, 20:02

        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 11 Oct 2015, 03:35 last edited by Colorfusion 10 Nov 2015, 03:36
        #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
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 11 Oct 2015, 20:50 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
          • C Offline
            C Offline
            Chris Kawa
            Lifetime Qt Champion
            wrote on 11 Oct 2015, 21:13 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

            4/5

            11 Oct 2015, 20:50

            • Login

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