On Tue, 28 Dec 2004 16:45, Hugh Dixon wrote:
> Hi,
> I'm a windows developer wanting to investigate OpenGL programing under
> linux.  I am using Mandrake 10.1, but have been having trouble with
> graphics cards. I currently have a system running, and have looked through
> the KDeveloper tutorials.  I now want tostart on OpenGL.  I gather QT is
> suppose to have a widget that supports OpenGL, however I cannot find it on
> my installation.
>
> Can someone please confirm that the mandrake install of qt should include
> this widget?
>
> If so, I suspect it is not installed on my machine because of the trouble I
> initially had with my graphics card (the trolltech site says it is only
> installed if openGL headers etc are available)  Uninstalling QT developer
> tools, forces the uninstall of a fair number of other packages, which I
> don't want to do.  Can anyone suggest a way to 'refresh' the install of qt,
> and/or force the install of the openGL stuff?
>
> Thirdly, Is qt the best way for me to go for an intro to openGL?  I am
> familiar with openGL under windows (and even on a sparc box).  I would
> however like access to a GUI API, which is why I though the QT widget was
> the way to go..
>
> Any comments?

Hugh,

I messed around with the QGLwidget a while ago for a project I never finished 
(typical, huh?).  I can't guarantee that what follows still holds, but it 
worked about a year and 2 Mdk versions ago.

Excuse me if I cover ground you are already aware of, but I find it's best to 
never make assumptions, and it's helpful for other interested observers.  

Well, I'll make a couple...  I'm assuming that you're coding C++/QT/KDE (so 
I'll ignore C/Gtk/Gnome options), using KDevelop, and that you have a urpmi 
source configured for Contrib.

Now for the possibly insulting parts :-)  

About RPMs.  Mandrake splits software into 3 types of RPM packages.  There's 
the Applications RPM, the Library RPM and the Development RPM.  The 
Application RPM holds the actual executable that goes in /usr/bin and related 
data and config files (Windows equivalent = .exe's). the Library RPM holds 
any common library files provided by the application that go in /usr/lib 
(Windows = .dll's).  The Developement RPM holds all the include files that 
you need if you want to compile code that use the libraries, these usually 
have -devel- in their name.  I'll list below what I think you need (don't pay 
too much attention to any version numbers, that just what's on my machine, 
just use what you have for now)

About OpenGL.  OpenGL on Linux is usually provided by the Mesa project 
(http://www.mesa3d.org/) working in with X11/Xorg.  To have Mesa OpenGL up 
and running, and able to be compiled against, you need the following packages 
installed:
        libxorg-x11-devel
        Mesa
        Mesa-demos
        libMesaGL1
        libMesaGLU1
        libMesaGLU1-devel
        libMesaglut3
        libMesaglut3-devel
Things are a bit more complex if you use an NVidia card, as they provide their 
own GLX library, but so long as you install the NVidia drivers AFTER Mesa, 
you should be fine, as it should also install it's own include file.  Make 
sure you actually have 3D acceleration working by running Tuxracer or the 
gears program.  If you have problems here, try to get them resolved before 
moving on.

About Qt.  Mandrakes version of Qt should have (as in used to when I played 
with it) support for OpenGL already compiled in (so you can ignore what the 
TrollTech site said about it only being enabled if the GL headers were 
available, that only applies if you do a compile of Qt yourself), and it 
should just work if you have all the required packages installed, you should 
not need to force a re-install.  The RPM's you need for Qt are:
        qt3-common
        qt3-example
        libqt3
        libqt3-devel
And if you want the Qt database functions as well:
        libqt3-mysql
        libqt3-odbc
        libqt3-psql

Qt has usually good documentation, which you can find online at:
        http://doc.trolltech.com/3.3/opengl.html
        http://doc.trolltech.com/3.3/qglwidget.html
There's also a number of example programs to look at:
        http://doc.trolltech.com/3.3/opengl-examples.html
These pages are also installed on your hard-drive with the qt-devel RPM at:
        /usr/share/doc/qt-3.3.3/doc/html/

Right, so if you have all those installed, along with KDevelop you're now 
(hopefully) ready to follow those KDeveloper tutorials.  You'll find the qgl 
header file at /usr/lib/qt3/include/qgl.h, which should be on your include 
path, so a simple #include <qgl.h> should do the trick.  I can't remember 
exactly, but in KDevelop you may need to tell Automake Manger to link against 
qgl?  Not sure there. 

An alternative to the native Qt widget is QGLViewer 
(http://artis.imag.fr/Members/Gilles.Debunne/QGLViewer/) which builds on it, 
RPM is:
        libQGLViewer1_3

If you prefer the OpenInventor approach, the official SGI version is available 
at http://oss.sgi.com/projects/inventor/, but RPMs are scarse due to 
licensing issues?

There is an alternative, more widely used implementation of OpenInventor 
called COIN (http://www.coin3d.org/), that also provides a set of Qt widgets 
called SoQt (nice pun!), install these with RPM's:
        libcoin40
        libcoin40-devel
        libsoqt20
        libsoqt20-devel

Another scene graph not OpenInventor compliant is OpenSceneGraph 
(http://www.openscenegraph.org/), RPM is:
        OpenSceneGraph

Another option is OpenProducer (http://www.andesengineering.com/Producer/) 
which seems to tie in with OpenSceneGraph(?), available as RPM:
        OpenProducer

So, there's enough options to well and truely confuse you for now!  I'd 
recommend starting with the basic native QGL widgets for now in some sample 
programs to get an idea of the Qt mental model, but you will quickly find 
these widgets to be a bit basic (unless that's what you want :-).  You can 
then look to move to a more convenient widget with extra bells and whistles 
by either moving  to using QGLViewer if you prefer native-style GL, or 
choosing between COIN and OpenSceneGraph if you prefer the scene graph 
approach.

Good luck, and don't hesitate to ask questions if I haven't been clear on 
something.

Cheers!

John.

-----------------------------------------------------------------------------
Forget that new hard drive, save some lives instead, donate to the Red Cross:
  USA:  https://www.redcross.org/donate/donation-form.asp
  UK:  https://www.donate.bt.com/bt_form_dec.htm
  OZ:  https://www.redcross.org.au/Donations/onlineTsunamiDonations.asp
  NZ:  https://www.banqonit.com/proxypage.aspx?boiid=205

____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to