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. Any ideas how makefiles work for opengl

Any ideas how makefiles work for opengl

Scheduled Pinned Locked Moved General and Desktop
14 Posts 5 Posters 5.8k 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.
  • T Offline
    T Offline
    theblizzfreak
    wrote on last edited by
    #1

    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
    0
    • D Offline
      D Offline
      dialingo
      wrote on last edited by
      #2

      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
      0
      • EddyE Offline
        EddyE Offline
        Eddy
        wrote on last edited by
        #3

        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
        0
        • L Offline
          L Offline
          ludde
          wrote on last edited by
          #4

          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
          0
          • T Offline
            T Offline
            theblizzfreak
            wrote on last edited by
            #5

            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
            0
            • T Offline
              T Offline
              theblizzfreak
              wrote on last edited by
              #6

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

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #7

                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
                0
                • T Offline
                  T Offline
                  theblizzfreak
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #9

                    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
                    0
                    • T Offline
                      T Offline
                      theblizzfreak
                      wrote on last edited by
                      #10

                      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
                      0
                      • Z Offline
                        Z Offline
                        ZapB
                        wrote on last edited by
                        #11

                        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
                        0
                        • T Offline
                          T Offline
                          theblizzfreak
                          wrote on last edited by
                          #12

                          @
                          <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
                          0
                          • L Offline
                            L Offline
                            ludde
                            wrote on last edited by
                            #13

                            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
                            0
                            • Z Offline
                              Z Offline
                              ZapB
                              wrote on last edited by
                              #14

                              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
                              0

                              • Login

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