Sponsored Content
Operating Systems Linux Ubuntu i am new to opengl , how to work opengl in ubuntu Post 302349140 by Ravikishore on Monday 31st of August 2009 07:58:40 AM
Old 08-31-2009
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:SmilieaintEvent(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 ....
 

9 More Discussions You Might Find Interesting

1. Linux

Help with OpenGL in Fedora Core 4.

I'm pretty much new to this Linux stuff, I installed FC4 the other night to try it out. I'm having a slight problem when launching Quake 3, it's giving me the error GLimp_Init() - could not load OpenGL subsystem I've updated my video drivers to the latest version and went through fglrxconfig,... (3 Replies)
Discussion started by: Filth Pig
3 Replies

2. AIX

Need to install opengl for GXT4500.

Hi, I try to install opengl bat it give a error that i need the opengl base level fileset 5.3.0.0 I use AIX 5.3 and my oslevel is now 5300-03. Where can i find the opengl files i need (5.3.0.0)? Thanks Peter. (1 Reply)
Discussion started by: xeonbb
1 Replies

3. Programming

How to compile openGL code which is in C++ in ubuntu

Hi, I am trying to compile openGL code which is written in c++ ..but i am getting error msgs like this root@lxdevenv:~/Desktop# g++ diss.cpp -o diss -I/usr/X11R6/include/ -L/usr/X11R6/lib -lX11 -lXi -lXmu -lglut -lGL -lGLU diss.cpp:1:23: error: windows.h: No such file or directory... (2 Replies)
Discussion started by: Ravikishore
2 Replies

4. Ubuntu

How to draw cylinder using openGL

Hi Sir, i am new to openGL, i want to know how to draw cylinder using openGL code in C or C++.. And i have to insert bitmap images on cylinder.. How to do this .. please guide me ... Thanking You in advance .. (0 Replies)
Discussion started by: Ravikishore
0 Replies

5. Programming

How to Decode an image using openGL

Hi, How to decode an image using openGL library libjpeg .. which are the steps needed to do this using C language.. actually my work is to decode the image, store it on the buffer, and place it on cube surface.. please guide me,,any answer will appreciated .. (8 Replies)
Discussion started by: Ravikishore
8 Replies

6. Programming

Draw a 3D cylinder using openGL.

Hi, please give me, how to code to draw 3D cylinder in openGL, that should be rotated in x-direction. waiting for your reply .. (2 Replies)
Discussion started by: Ravikishore
2 Replies

7. Programming

How to install openGL packages?

Hi, Any one help me regarding how to install openGL packages to work in linux. And i installed some of the packages(gl,glu), but i don't know whether they are installed are not .. Which command is should use to check whether openGL is installed are not .. I am Thankful for any kind of... (3 Replies)
Discussion started by: Ravikishore
3 Replies

8. Solaris

Solaris 8 and openGL

Hi everybody, Sorry to bother you one more time, but I have a problem with my Solaris 8 installation. Actually, Solaris works well, I can start X and access my desktop (CDE), but I'm having troubles using Cadds (a CAO software). Cadds works, but the 3D visualization is very slow compare to... (4 Replies)
Discussion started by: firstpost
4 Replies

9. UNIX Desktop Questions & Answers

Difference between opengl es and directfb

i dont know in which forum to ask this question ..... :( . pardon me if it is not this forum i wanted to know difference between openGL ES and directfb as far i know directfb is alternative to x11 in linux for embedded devices. something like ... application | ... (1 Reply)
Discussion started by: alexzander18
1 Replies
Graphics2D(3pm) 					User Contributed Perl Documentation					   Graphics2D(3pm)

NAME
PDL::Graphics2D - An object oriented interface to PDL graphics SYNOPSIS
use PDL::Graphics2D; $win = PDL::Graphics2D->new(<Interface>, <Options>); $w = imag2d( $image, 'Title Here', ... ); DESCRIPTION
This is an umbrella class allowing for a simple interface to all plotting routines in PDL. On its own it does not do any work it merely passes information to the appropriate class. Ideally this should probably offer a uniform interface to a variety of packages. This requires a lot more work before it is useful I feel, but it can be used already. CONSTRUCTORS
new Create a 2-D graphics object with the requested interface type FUNCTIONS
imag2d Display a 2-D image in a figure window imag2d() creates a plain FreeGLUT OpenGL window and displays the input image with 1:1 aspect ratio for pixels. The window resize is constrained to the actual ratio of the image dimensions. The initial display size is currently a 200x200 window to prevent things from being too small by default. The image to display can have dimensions ($c,$M,$N) where for $c==4 the display is in GL_RGBA, for $c==3 the display is GL_RGB, for $c==2 the display is GL_LUMINANCE_ALPHA, and for $c==1 or for for dimensions ($M,$N) then the display is GL_LUMINANCE. This routine does not yet thread but multiple images may be viewed at the same time in separate windows by multiple calls to imag2d(). TriD graphics visualization windows and the imag2d() windows may be created and used independently. NOTE: If you are twiddling a TriD window, the imag2d() windows are active as well. If you call twiddle() the sub, only the imag2d() windows will update correctly. $window_id = imag2d($image, $name, $zoom, $x_off, $y_off); creates a new image figure window from the input piddle with the given title, zoom factor, and position (if possible) $window_id - may be used to refer to the figure window $image - 2D image piddle with at least 2 or 3 dimensions e.g. [M,N], [1,M,N], [2,M,N], [3,M,N], [4,M,N] $name - the name to use for the figure window (optional) $zoom - desired (float) pixel zoom factor (optional) ($x_off, $y_off) - desired window pixel position (optional) with (0,0) as the top left pixel of the display use PDL::Graphics2D; # imports imag2d() and twiddle() $a = sequence(64,48,3); # make test RGB image $a = $a->mv(2,0); # color must be dim(0) with size [0..4] $a /= $a->max; # pixel values in [0.0,1.0] $a = sin(10*$a); $w1 = imag2d($a); # with parens... $w2 = imag2d $a->sqrt; # or without $w3 = imag2d $a**2; imag2d_update Update an existing imag2d window with new piddle data $image = random(3,64,48)/2 + 0.25; # random pixel image $win = imag2d($image); # create original image display imag2d_update($win, $image->sequence/$image->nelem); # update data "imag2d_update" allows one to update an "imag2d" display window by replacing the associated image data with new contents. The new image data must be the same type and shape as the previous. Eventually, we would like to implement this via some sort of dataflow that would be transparent to the user. twiddle Enable GUI interaction with a FreeGLUT display window. twiddle(); Runs the FreeGLUT event loop so window GUI operations such as resize, expose, mouse click,.. work perl v5.14.2 2012-02-10 Graphics2D(3pm)
All times are GMT -4. The time now is 12:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy