opengl and c++

Started by
15 comments, last by _paf 11 years, 2 months ago

Hey, i recently bought the official book (8th edition) from safari books online and i have some questions:

1. i cant get any compiler to run opengl on c++, can you give me one that i should use? and how can i get it to work? (glut not working either)

2. where can i get the sample from the book? i mean there are function's that they make and i wanna see how they make it.

3. the book is a little hard for me because im kind of new to all that stuff (not programming) and i wanted to ask you how can i

learn what is all that shader stage's and stuff because it's really hard for me to get it and im trying really hard..

is there a site or something that explain it a little bit more understandable for me?

(my english is not that good and i some words may cause me some problems to understand and i really want to understand all of the book..)

if you guys could help me out that would be great!

i really need help on the third one though that's my priority :)

thanks!

Advertisement

Firstly, i've never read he book you're talking about, so i can't help you with those functions.

Now for the compilers.

If you're using windows, you can download the Microsoft Visual C++ Express 2010/2012 for free.

If not, then you can download code::blocks and use the MinGW compiler that comes with it.

If you can't make GLUT work, and you get linker errors, then you have to put the glut32.lib (or whatever it's called) in your compiler linker path.

For tutorials, you can go to http://nehe.gamedev.net/, although the tutorials are outdated, they still provide some good information.

For newer, shader based, OpenGL, you can go to http://www.arcsynthesis.org/gltut/index.html which has very useful tutorials about 3D programming. It uses GLUT in the examples though.

Also, these tutorials provide source code to compile and modify yourself, to try new things.

There are more compilers/IDEs, and sites, but i think these are the main used ones.

Hope it helps.

where can i find glu32.lib?

thanks for the help! :)

glu32.lib is the windows GLU static library.

You can download GLU here http://www.oocities.org/vmelkon/glu.html

If you need glu32.lib, chances are you are using legacy OpenGL. If you do that, make sure you understand what it means.

In the same way, don't spend too much time on the NEHE tutorials until you know about legacy OpenGL.

[size=2]Current project: Ephenation.
[size=2]Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

i really dont knot what i need actually :\

i need glut i guess but how do i add it? (is it glu32.lib?)

if not, what is it and where can i find it and make it to work with my compiler?

thanks!

AS larspensjo said, GLU and GLUT are deprecated, along with the NeHe tutorials (i just mentioned them, because they still provide some insight).

It's okay if you use them when you're starting learning, but they are no longer used in modern OpenGL.

The glu32.lib goes into the compiler lib folder. Then to use it in a project, you have to go to the project properties (this depends on the editor), and add the glu32.lib in the linker search path. Visual C++ has something like "Additional linker dependencies" in the project options, under the "Linker" tab.

I'm not an expert but this is what works for me:

to use OpenGL you need to #include <GL\GL.h> and <GL\GLU.h>

and also you need to link to OpenGL32.lib and glu32.lib (in visual studio 2012, Project > Properties > Configuration Properties > Linker > Input > Additional Dependencies )

GL and GLU are part of OpenGL (correct me if I'm wrong! ), GLUT is an external library so it's your choice if you want to use it. but if you use OpenGL you will need a library to set up your windows (so that you can use OpenGL to draw in them ) GLUT is an example of this.

the most useful book I came across is OpenGL Programming Guide.

PS. if you are a student you can use www.dreamspark.com to get Visual Studio for free

good luck ^^

sorry i didnt know the differences between glu and glut.

so glu32.lib != GLUT?

if so what should i do to make glut to work with my compiler?

sorry for the newbie question's its just that im learning from the new book they going to release and there isn't any example's online (the site is down for like a month now) and

they using separate files to compile the code.. (the files that i need to see is not in the book but online.. :\ )

and if someone could help me out and tell me how can i learn better from this book (like how to get the online example if the main page of the site is down) that would be great! :)

thanks a lot for your help!

OpenGL is the API.

Both GLU and GLUT are external libraries that provide functionality (and easiness of use) to OpenGL.

GLU serves many purposes, which can range from setting perspectives, building textures & mipmaps, creating predifined meshes (cone, etc) and more.

GLUT is a window management library for OpenGL. It allows you to create a window in any OS without using OS dependant code, hence it is portable.

glu32.lib is the GLU library.

glut32.lib is the GLUT library

And yes, the path for Visual C++ mentioned by hikarihe is correct, and is the same for VC++ 2010 Express.

I don't know if you need to be a student at that site though. When i downloaded Visual C++ 2010 Express i think it was on the Microsoft website (i still use 2010).

This topic is closed to new replies.

Advertisement