PDA

View Full Version : Learning OpenGl programming



Sarthos
08-24-2006, 03:57 PM
Ok, I already know C, and a bit of C++ programming, but where could I find tutorials to learn OpenGL programming, and what kinds of toolkits would you recommend to use? I have WxDev-C++ for my C++ program, and a whole bunch of OpenGL toolkits already. But, I can't afford to spend money on expensive toolkits or tutorials.

zeoverlord
08-24-2006, 04:18 PM
http://nehe.gamedev.net
This is all you need to know for now. :)

Sarthos
08-24-2006, 05:48 PM
I got stuck on the first tutorial :@

[Linker error] undefined reference to `gluPerspective@32'

Zengar
08-24-2006, 06:43 PM
You need to link to the GLU and GL libraries. I don't use C so I don't really know the libraries name (I guess libGLu on unix, but you can just look in your lib folder) or how one links against it :-) But I am sure you will find out.

Overmind
08-25-2006, 01:12 AM
Its -lGL -lGLU on Linux and opengl32.lib, glu32.lib on windows ;)

Sarthos
08-25-2006, 10:06 AM
I'm sane, I don't use Linux or Macs :p

Umm...I can't find the libraries :mad: Even though I have the stuff with OpenGl installed :mad:

Edit: I have libglu32.a and libopengl32.a, but no opengl32.lib or glu32.lib

dorbie
08-25-2006, 12:04 PM
Those are static libs and definitely not what you need.

Figure out who designed your graphics card (NVIDIA or ATI hopefully), download their SDK and install it, you'll then have the requisite files on your disk and you should be able to find them.

Zengar
08-25-2006, 12:12 PM
If you use GCC then the libopengl32.a should be correct, or? Try linking with -lGL -lGLU, this probably would work

Sarthos
08-25-2006, 12:20 PM
ATI Radeon X300/X550 :)

Wait...the Radeon SDK is 350 MB :( will the directx SDK work?

Edit: the DirectX one is 337 MB, so I'll just use the Radeon one, I guess...

Edit again: if I want to use my other computer (with an Intel graphics card) then should I use the DirectX SDK? or not use that computer since it has dial-up, and I'd never be able to download a 300 MB file?

songho
08-25-2006, 01:43 PM
Sarthos,
Since you already have Dev-C++, practice OpenGL programming with Dev-C++. Dev-C++ includes a project template for OpenGL application, so you can start OpenGL very easily.

First, try to compile and run the sample code, which comes with Dev-C++;
File >> New >> Project >> Multimedia >> OpenGL

You can also download Nehe tutorial projects, which are built for Dev-C++. And you may need GLUT package for Dev-C++. I use GLUT 3.7.6+ glut.3.7.6+.DevPak. Download it from;
http://www.nigels.com/glt/devpak/
==song==

Sarthos
08-25-2006, 04:44 PM
but, will that stop the error I'm getting about gluperspective@32?

And I can't find those .lib files, even after I downloaded and installed the Radeon SDK...Must I install the DirectX one, too?

ZbuffeR
08-25-2006, 06:37 PM
you can't fail it with the builtin template for Dev-C++. No need for some stupid SDK.

Here are the parameters for linking
-lopengl32 -lglu32

And the lib files are named libopengl32.lib etc.

Sarthos
08-25-2006, 07:46 PM
umm...I DON"T HAVE THOSE LIBs ON MY COMPUTER!

songho
08-25-2006, 10:37 PM
Originally posted by Sarthos:
umm...I DON"T HAVE THOSE LIBs ON MY COMPUTER! Yes, you have them if you install wxDev-C++ (or Dev-C++) on your computer. It comes with GL and GLU libs. Please check your wxDev-C++ installation folder; $(your Dev-Cpp dir)\lib.

You can find the following two libraries in that folder;
libopengl32.a
libglu32.a

Once you can compile and run the template project, which comes with Dev-C++ (as I mentioned before), then everything is installed properly and ready. Now, you can move on writing your own codes or try to compile Nehe tutorials.

For example, try to compile the second tutorial from Nehe, which is drawing the first polygons. The direct link to the tutorial for Dev-C++ project is;
http://nehe.gamedev.net/data/lessons/devc/lesson02.zip

Uncompress it and open up "Lesson2.dev" by double-clicking. You will encounter a compile error if you don't have glaux library in Dev-C++ environment. (NOTE: glaux is not recommended anymore, even though Nehe tutorials still use it.)

Anyway, in order to compile "Lesson2" tutorial, you need to download the glaux package by using Dev-C++ package manager;
Tools >> Check for Updates/Packages...

Or, from DevPaks repository;
http://devpaks.org/details.php?devpak=4

As ZbuffeR mentioned, you do not need ATI Radeon SDK at all.
==song==

08-25-2006, 11:39 PM
"And I can't find those .lib files, even after I downloaded and installed the Radeon SDK...Must I install the DirectX one, too?"

install the sdks THEN dx one, then mesa then antivirus! :rolleyes:

Musicianbruce
08-26-2006, 07:12 AM
I found www.spacesimulator.net (http://www.spacesimulator.net) very interesting tutorials with examples.

Sarthos
08-26-2006, 09:43 AM
the .lib files aren't on my computer, but the .a files are. I downloaded the project, instead of copying it piece by piece, and it works now :)

<s>Darn it...One of the tutorials is stuck, because I don't have glaux.dll. Where can I find that?</s>

How can I load 3d files into OpenGL? I'm much better at modelling stuff in 3d than I am in text or in Dev-C++ ;)

Sarthos
08-28-2006, 10:43 AM
Is there anyone who has MSN who may be able to help me with this stuff over MSN?

08-29-2006, 12:48 AM
Hi,

You know, many people have gone out of their way to help you, yet I detect no gratitude on your part. Some indication that people are not wasting their time would be appreciated, at least for my part. I could be giving myself a good wedgie right now, or trying to induce a cramp in my left leg. But I've decided to help people, or at least try to, because I believe that there are people that truly appreciate it.

Read all the replies again. There should be enough here to get started.

hth

Sarthos
08-30-2006, 12:52 PM
sorry if I haven't been very polite, (usually I am more polite) but I've been stuck working mostly 6 or 7 days a week, and have done almost nothing but worked this whole summer, until it's almost time for school to start again. it's really annoying to do that...