09-01-2009
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.
Last edited by Corona688; 09-01-2009 at 05:20 PM..
9 More Discussions You Might Find Interesting
1. Linux
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
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
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
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
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
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
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
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
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
LEARN ABOUT DEBIAN
sdl::cookbook::opengl
pods::SDL::Cookbook::OpenGL(3pm) User Contributed Perl Documentation pods::SDL::Cookbook::OpenGL(3pm)
NAME
SDL::Cookbook::OpenGL - Using SDL with OpenGL
CATEGORY
Cookbook
DESCRIPTION
As of release 2.5 SDL no longer maintains it's own bindings of OpenGL. Support for OpenGL has been moved over to a more mature
implementation.
This implementation is the POGL project. OpenGL is faster and more complete; and works with SDL seamlessly.
EXAMPLE
Expanded from Floyd-ATC's OpenGL example.
use strict;
use warnings;
use SDL;
use SDLx::App;
use SDL::Mouse;
use SDL::Video;
use SDL::Events;
use SDL::Event;
use OpenGL qw(:all);
You can use OpenGL as needed here.
my ($SDLAPP, $WIDTH, $HEIGHT, $SDLEVENT);
$| = 1;
$WIDTH = 1024;
$HEIGHT = 768;
$SDLAPP = SDLx::App->new(title => "OpenGL App", width => $WIDTH, height => $HEIGHT, gl => 1);
$SDLEVENT = SDL::Event->new;
SDLx::App can start an OpenGL application with the parameter gl => 1.
glEnable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
gluPerspective(60, $WIDTH / $HEIGHT, 1, 1000);
glTranslatef(0, 0, -20);
Above we enable GL and set the correct perspective
while(1) {
&handlepolls;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glRotatef(.1, 1, 1, 1);
&drawscene;
$SDLAPP->sync;
}
For SDLx::App sync handles the GL buffer clean.
sub drawscene {
my ($color, $x, $y, $z);
for (-2 .. 2) {
glPushMatrix;
glTranslatef($_ * 3, 0, 0);
glColor3d(1, 0, 0);
&draw_cube;
glPopMatrix;
}
return "";
}
sub draw_cube {
my (@indices, @vertices, $face, $vertex, $index, $coords);
@indices = qw(4 5 6 7 1 2 6 5 0 1 5 4
0 3 2 1 0 4 7 3 2 3 7 6);
@vertices = ([-1, -1, -1], [ 1, -1, -1],
[ 1, 1, -1], [-1, 1, -1],
[-1, -1, 1], [ 1, -1, 1],
[ 1, 1, 1], [-1, 1, 1]);
glBegin(GL_QUADS);
foreach my $face (0..5) {
foreach my $vertex (0..3) {
$index = $indices[4 * $face + $vertex];
$coords = $vertices[$index];
glVertex3d(@$coords);
}
}
glEnd;
return "";
}
Below we can use SDL::Events as normal:
sub handlepolls {
my ($type, $key);
SDL::Events::pump_events();
while (SDL::Events::poll_event($SDLEVENT)) {
$type = $SDLEVENT->type();
$key = ($type == 2 or $type == 3) ? $SDLEVENT->key_sym : "";
if ($type == 4) { printf("You moved the mouse! x=%s y=%s xrel=%s yrel=%s
", $SDLEVENT->motion_x, $SDLEVENT->motion_y, $SDLEVENT->motion_xrel, $SDLEVENT->motion_yrel) }
elsif ($type == 2) { print "You are pressing $key
" }
elsif ($type == 3) { print "You released $key
" }
elsif ($type == 12) { exit }
else { print "TYPE $type UNKNOWN!
" }
if ($type == 2) {
if ($key eq "q" or $key eq "escape") { exit }
}
}
return "";
}
SEE ALSO
perl SDLx::App OpenGL
AUTHORS
See "AUTHORS" in SDL.
perl v5.14.2 2012-05-28 pods::SDL::Cookbook::OpenGL(3pm)