June 30, 2011

theblizzfreak theblizzfreak
Lab Rat
50 posts

any ideas how makefiles work for opengl

 

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 [developer.qt.nokia.com] , Gerolf

13 replies

June 30, 2011

dialingo dialingo
Lab Rat
158 posts

Avoid writing Makefiles if possible. Write .pro files and use qmake to generate your Makefile.
To add an includepath:

  1. INCLUDEPATH += C:/mylibs/extra_headers

To link additional libraries:

  1. LIBS += -L/usr/local/lib -lmath

June 30, 2011

Eddy Eddy
Gene Splicer
1296 posts

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

 Signature 

Qt Certified Specialist
Qt Ambassador

June 30, 2011

ludde ludde
Lab Rat
325 posts

Not sure what you are trying to do, but to create a Qt project that works with OpenGL you just have to add

  1. QT += opengl

to your .pro file.
And, of course, include the header files you need from your source code, e.g.
  1. #include <QtOpenGL>

July 4, 2011

theblizzfreak theblizzfreak
Lab Rat
50 posts

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

July 4, 2011

theblizzfreak theblizzfreak
Lab Rat
50 posts

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

July 4, 2011

ZapB ZapB
Robot Herder
1359 posts

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.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

July 4, 2011

theblizzfreak theblizzfreak
Lab Rat
50 posts

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

July 4, 2011

ZapB ZapB
Robot Herder
1359 posts

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.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

July 4, 2011

theblizzfreak theblizzfreak
Lab Rat
50 posts

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?

July 4, 2011

ZapB ZapB
Robot Herder
1359 posts

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).

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

July 4, 2011

theblizzfreak theblizzfreak
Lab Rat
50 posts

  1. <include> iostream
  2. using namespace std;
  3.  
  4. int main ()
  5. {
  6.  
  7. {
  8.  cout << "im talking in c++ :P";
  9. {
  10.  
  11.  
  12.  
  13.  
  14. system ("pause");
  15. return 0;
  16. {

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]

July 5, 2011

ludde ludde
Lab Rat
325 posts

To use OpenGL with Qt, you need a QGLWidget. Have a look at the documentation [doc.qt.nokia.com], it will tell you most things you need. If that’s not enough, have a look at an example, e.g. Hello GL [doc.qt.nokia.com].

July 5, 2011

ZapB ZapB
Robot Herder
1359 posts

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.

 Signature 

Nokia Certified Qt Specialist
Interested in hearing about Qt related work

 
  ‹‹ importing *.doc,*.docx to Qt project      QTextCursor::clearSelection() doesn’t work ››

You must log in to post a reply. Not a member yet? Register here!