i am new to opengl , how to work opengl in ubuntu

Hi,

i am new to opengl, how to work openGL in ubuntu ,,

i am not getting which packages as to be install and how to install those packages.

and how to work with small programs..

Please guide me ,,, it will appriceated ...

Ubuntu is really the wrong platform for programming... There's such a heavy snow of *-dev packages needed to do anything at all. You will of course need to install gcc and perhaps g++. needed libraries might begin with libgl1-mesa-dev, glutg3-dev, libglui-dev, libglut3-dev... Not having an ubuntu machine I can't say how many more would be necessary to install to stop it complaining about missing headers. Also, using SDL would be a lot easier than using OpenGL raw. It sets it up for you so you can use OpenGL raw, but in a relatively simple and platform-independent way. There are many tutorials for SDL opengl available on the internet.

Hi Sir,

I worked with c programs in ubuntu for openGL,,, now im trying to execute the c++ programs for openGL ,,,, while compiling its showing error message as

root@lxdevenv:/usr/include/GL# g++ -c -I$QTDIR/include ravvv.cpp
ravvv.cpp:1:18: error: kapp.h: No such file or directory
ravvv.cpp:2:24: error: qwidget.h: No such file or directory
ravvv.cpp:3:75: error: qpainter.h: No such file or directory
ravvv.cpp:4:23: error: qimage.h: No such file or directory
ravvv.cpp:7: error: expected class-name before �{� token
ravvv.cpp:8: error: expected `}' at end of input
ravvv.cpp:8: error: expected unqualified-id at end of input
root@lxdevenv:/usr/include/GL#

and my code is

#include <kapp.h>
#include <qwidget.h>
#include <qpainter.h> // The QPainter class draws graphics on widgets.
#include <qimage.h>

class MyWindow : public QWidget
{
public:
// Constructor for the window, just call the QWidget constructor
MyWindow() : QWidget() { }
protected:
void paintEvent(QPaintEvent *);
};

// This function is called when the window area must be updated.
// Load and view the image
void MyWindow::paintEvent(QPaintEvent *ev)
{
// Load the image that we want to show
QImage image;
if (image.load("test.jpg", 0)) // If the image was loaded,
{ // Show the image.
// Draw graphics in this window
QPainter paint(this);
// Draw the image we loaded on the window
paint.drawImage(0, 0, image, 0, 0,
image.width(), image.height());
}
}

int main(int argc, char **argv)
{
KApplication app(argc, argv)
// Create the window
MyWindow window;
app.setMainWidget(&window);
window.setCaption("ImageIO Example");
window.setGeometry(100,100,300,300);
window.show();
return app.exec();
}

guide me ..it will appreciated ....

It looks like you need qt-dev, or something like qt-dev.

This code will only work with qt by the way, which is wholly unnecessary for OpenGL. It's probably a bad idea in general to tie functionality that has nothing to do with a GUI into a GUI, as it will make it very hard to make the code work anywhere else. You need X and mesa and SDL; write for that and your GL code should work anywhere.

here's a better introduction I think. Took me a while to find it. SDL is nearly everywhere these days, unlike qt.

Hi Sir,

I installed SDL and executed the small program ,,, its executed without any error ,,

after that i downloaded SDLgears-1.0.2.tar.gz

and i did ./configured it ..
done make
after that i did ./SDLgears
I got the output ,,,

Thanking You Sir ,,,

---------- Post updated at 12:36 AM ---------- Previous update was at 12:32 AM ----------

Hi Sir,

              As im new to OpenGL im not getting which are the different applications for each Features  in openGL ..

if possible give me the example for different applications ,,

Thanking You,

That's too broad a question for me to have a useful answer to, could you be more specific?

Hi Sir,

      What i meant to say is what are the different applications where openGL is Used..

         I need programming\(c language\) examples for each applications ,,,,

There is no fixed list of uses for OpenGL, programmers can do whatever they please with it. And there are thousands and thousands of programs, but somehow I doubt listing them all would begin to answer your question. I suspect your question still isn't translating.