Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Any ideas how makefiles work for opengl

    General and Desktop
    5
    14
    4323
    Loading More Posts
    • 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.
    • T
      theblizzfreak last edited by

      Semi Annoying i feel :( but i got another question any ideas how make files work i need to change some of the text in my proj file to use opengl with headers and i dont really understand it i can reread and try there but it would be awesome if i could get some first hand answering

      edit : sorry let me rephrase i need to know how to make QT Work with qtopengl Headers i read up that it was to do with 'MAKE' files or something any ideas

      EDIT: split of "this thread":http://developer.qt.nokia.com/forums/viewthread/7309/ , Gerolf

      1 Reply Last reply Reply Quote 0
      • D
        dialingo last edited by

        Avoid writing Makefiles if possible. Write .pro files and use qmake to generate your Makefile.
        To add an includepath:
        @INCLUDEPATH += C:/mylibs/extra_headers@

        To link additional libraries:
        @LIBS += -L/usr/local/lib -lmath@

        1 Reply Last reply Reply Quote 0
        • E
          Eddy last edited by

          i would suggest to start another topic with your second question. That way you will get more attention in the forum.
          Did you succeed to get the examples now?

          Edit : thanks Gerolf

          Qt Certified Specialist
          www.edalsolutions.be

          1 Reply Last reply Reply Quote 0
          • L
            ludde last edited by

            Not sure what you are trying to do, but to create a Qt project that works with OpenGL you just have to add
            @QT += opengl@
            to your .pro file.
            And, of course, include the header files you need from your source code, e.g.
            @#include <QtOpenGL>@

            1 Reply Last reply Reply Quote 0
            • T
              theblizzfreak last edited by

              okay im back sorry for the long wait there! okay i dont even know where to put the QT += opengl part in the pro file it self i know where the file is i got it selected but where exactly on the pro file its self

              and include the header files? what like if im using opengl with qt i put that into the include code part

              1 Reply Last reply Reply Quote 0
              • T
                theblizzfreak last edited by

                and Qmake? what where do i get it how do i use it and the hole nine yards

                1 Reply Last reply Reply Quote 0
                • Z
                  ZapB last edited by

                  Anywhere in the .pro file will do but the QT variable normally gets placed outside of any scopes in the .pro file.

                  Create a new project in Qt Creator, add QT+=opengl to the generated .pro file and build it. Qt Creator will take care of running qmake and compiling the project for you.

                  Nokia Certified Qt Specialist
                  Interested in hearing about Qt related work

                  1 Reply Last reply Reply Quote 0
                  • T
                    theblizzfreak last edited by

                    then i can just start writing opengl code into Main.qml?

                    1 Reply Last reply Reply Quote 0
                    • Z
                      ZapB last edited by

                      Wha? You need to put OpenGL code into a C++ file since it needs to be compiled (OK there is a capability of QML in a special plugin to embed GLSL shaders directly into yoru QML items but that is very new and unsupported).

                      Take a look at the OpenGL examples that ship with Qt itself.

                      Nokia Certified Qt Specialist
                      Interested in hearing about Qt related work

                      1 Reply Last reply Reply Quote 0
                      • T
                        theblizzfreak last edited by

                        Oh okay :D cool so you make another Source file and Call it whateva.cpp then inside that you type a bunch of opengl code press run and it works ? :D lol im just trying to make shore i get this 100% exact

                        do i need to have any headers ? with the cpp?

                        1 Reply Last reply Reply Quote 0
                        • Z
                          ZapB last edited by

                          Well I would start off with learning C++ before you dive into OpenGL. Once you are comfortable with C++ then take a look at Qt and finally learn about OpenGL.

                          Qt ships with a huge number of examples and demos. Take a look at those and the documentation that comes with them (hint use qtdemo to launch the demos and the docs).

                          Nokia Certified Qt Specialist
                          Interested in hearing about Qt related work

                          1 Reply Last reply Reply Quote 0
                          • T
                            theblizzfreak last edited by

                            @
                            <include> iostream
                            using namespace std;

                            int main ()
                            {

                            {
                            cout << "im talking in c++ :P";
                            {

                            system ("pause");
                            return 0;
                            {
                            @

                            im fine with c++

                            im still learning opengl :) i just need to be told the meaning and exact information too fully understand which then misconcepts alot too that im a noob lol too most people dont worry about it

                            [EDIT: code formatting, please wrap in @-tags, Volker]

                            1 Reply Last reply Reply Quote 0
                            • L
                              ludde last edited by

                              To use OpenGL with Qt, you need a QGLWidget. Have a look at the "documentation":http://doc.qt.nokia.com/latest/qglwidget.html, it will tell you most things you need. If that's not enough, have a look at an example, e.g. "Hello GL":http://doc.qt.nokia.com/latest/opengl-hellogl.html.

                              1 Reply Last reply Reply Quote 0
                              • Z
                                ZapB last edited by

                                Take a look at (or get an svn checkout of) this section of my repository to see how I have ported the first few examples from the OpenGL SuperBible book to Qt.

                                Nokia Certified Qt Specialist
                                Interested in hearing about Qt related work

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post