Beginner Questions

Need some help ? :confused:

  1. Why should I learn OpenGL instead of DirectX ?

  2. Using OpenGL: should I use something like Ogre3D or OpenSceneGraphic (OSG) OO libraries or learn OpenGL ?

  3. Is there some sites to learn OpenGL the right way ?

Thanks a lot

  1. Because it’s the right thing to do, and a tasty way to do it.

  2. That’s silly. You learn OpenGL by using OpenGL.

  3. Well, you’re already there. Though technically you don’t need a website to learn OpenGL (or anything else for that matter). You might try reading a book, for example (just a thought).

  1. I think it’s good to know both. Without going into much detail, each has it’s good side and bad side. I suggest you search for previous replies.

  2. GL is low level 3D graphics while the other 2 are higher level. The other 2 might be enough for your goals. Ogre is LGPL and open source.

  3. Let’s assume that you want to learn the modern stuff of GL and ignore the rest. Most tutorial sites are aimed at newbies and just start with GL 1.1 because it is simpler. For example, it is simpler to use glBegin/glVertex/glEnd instead of VBO (vertex buffer objects)
    But that’s ok because you can learn that and move your way up.
    You can try NeHe’s site (
    They cover from the basic to the advanced.

1.) When you are new to this, I guess OpenGL is the same (or less) effort to learn.
Pros: You are not bound to Microsoft. AND: you are system-independent (if you have nice clean C code it will compile on win, linux, solaris and many more without a line to change.)
OpenGL was much more powerfull from the very beginning, but at that time the available hardware was too weak. OpenGL is still a bit more powerfull I think (stencil buffer…), considerering speed they are equal I think.

2.) Start with OpenGL, and GLUT. GLUT is for the impatient, it will give you some rendeed images with a few lines of code. It is a good way to get into it, especially if you are not that experienced programmer. The GLUT commands are an easy-but-less-powerfull assembly of OpenGL-Commands. As soon as you get to the limits of GLUT, you will go one level deeper into the pure OpenGL naturally.
I dont know the higher level libs you mentioned (of course i know them, but never used them) but going to the high level without knowing at lest some of the basics will get you into trouble sooner or later.

3.)This site is where you schould start ( Look under
Coing resources/Sample Code&Tutorials

NeHe is also very good.

With thode two sites you have enough stuff for at least a month to program.

There is tons of stuff for OpenGL and GLUT.
Dont start too fast, Try to get into vertexes, lines, triangles, quads. Then some lightig, and smooth shading (that is easy with GLUT, and need some understanding in pure OpenGL, but this will give you a great AHA!-experience and make your further OpenGL-life much easier)
Then I would start with texturing.

I’ve got nothing against tutorials, but waiting for other people to disseminate information and feed it to you though a straw isn’t for everyone. If you are industrious I strongly urge you to just read books, lots of them. It cost money, sure, but it’s well worth it (ask any professional).

Learning 2 or more APIs is less important initially than just learning graphics (the same math and techniques apply equally to all of them). Get solid in the basics. Details like which API to use will seem silly later (you’ll see).

  1. OpenGL is a lot easier for a beginner to learn because the openGL API is nice and clean compared to D3D.

  2. No, only use them if you are actually going to make something, instead of just learning.

    That’s all you need to know.
    That and buy some books, the openGL red book is good.

And on another note, in a few weeks nehe will be relaunching with fresh new tutorials that are more in line with todays computer graphics.

Tks a lot.
Howerver, must start from the beginning. I working with C++ and Java now, what was some good choices I’ve made at the time.

I know Java has it’s own API, Java3D based on OpenGL. I’ll work on that one, for sure.

Also, will learn OpenGL because it’s not M$ stuff. Nothing against it.

Thanks a lot again!

I’d like to give you my feedback about this week.
Started with a few samples using GLUT. That’s really cool and also easy way to strat.
Major problem was to fix up my IDE and set the compiler…that was boring, but was just once!

Kinda sad knowing GLUT is totally out of date and haven’t found a good GUI for using under Windows that hasnt been out of date too. FLTK seems to be a good choice for now, but havent read its license yet.

I’m also reading OpenGL Programming for the X Window System by Mark J. Kilgard…it’s a good start I believe.

If there’s someone with some tips about good (and please, easy) GUIs and other stuff that could be usefull, don’t be shame!


Great you found GLUT as easy as i thought.
For Compiler-Seup: I use Dev-C++ which is a free IDE and Compiler, and you can download ALL you need for Opengl, GLUT and much much more with the built-in Package manager. And most of the packages come with some sample files and much more important with some “project templates” where alle the needed libs and compiler options are already set. This really saves time and nerves.

I also use FLTK, which was the only choice for me because of licencing. Most GUI-libs are GPLed, which doesnt allow you to use them in a closed source software.
FLTK is under LGPL with explicit allowing of static linking, so you can use it for closed source.
FLTK is really powerfull, it comes with a built in GLUT-emulation, because you will soon realize that original GLUT takes away all the control of window management. I got rid of GLUT when i switched to FLTK. Only pure OpenGL in my Code.
Before that i used GLUI, which is great for some basic GUI, but gives you only little control of the layout. Licencing of GLUI might be a problem.

And with FLTK you stay Cross-Plattform, as it is available for Win, Linux, Mac. It also comes with FLUID, a great grafical Designer for FLTK-things. It does most of the Programming for you!

I forgot: If you like GLUT you should try freeGLUT and openGLUT, both are still active and have some better features (like getting control over window management)

Tks…seems we have a lot in common.

Im also using DevC++

Could we talk more on msn?

Just a thought - if you want to create dialog boxes that have some OpenGL views then you could consider using wxWidgets instead of GLUT.
Just start with the ‘minimal’ sample application and let it grow - I’m using wxWidgets + GLEW for all my tools.

In factI’m not that worry about multi-plattaform stuff, cause I’d like to focus on OpenGL first.

There’s one thing I don’t like wxWidgets…the file size is tooooo big.

Anyway, thanks for the tip!

Sorry jasm, no msn. Lets just stay here. (If that invitation was pointed to me)

I guess you went through some GLUT, you really should try all you find here (though some may only compile on linux-system because of missing glaux.H)
And all you find on NeHe, there is a lot of stuff prepared for DevC++, so just download and compile.

After that you have seen most of OpenGL.

If you want to go FLTK then I guess you already have the package downloaded and installed.

FLUID is in the /bin subdirectory in the DevCpp-dir.
I use FLTK 1.1.7, the latest stable release.

go through ERCOs page

for some tricks.
Download the .pdf-Documentation and take it as a programming reference.

Download the 1.1.7 source, there are lots of examples included (for visualc, but DevC++ can perfectly import that projects, you just need to add (copy/paste) the compiler-options from a FLTK-template)

If you got used to FLUID, you should really use the object-orientet way. Yes, it does it all for you, you just have to click the icons in the rigt order, FLUID creates the nicest and cleanest code you can imagine.
I actually started by evading Objects, but as your project grows, you wont be able to manage your code without it, as I was. Overhead is small, i can tell you that. I had to rewrite/recreate my whole app from a certain point on.

If you need help including OpenGL-views using FLUID i will post a small tutorial, but its already well described in the pdf-Doc and on ERCOs page.

Ah, and for the file-size: FLTK does a lot of static linking! So .exe-files may be huge (1-3MB) even for small projects. Some Hints: turn off all debugging information, turn on highest optimization, use CPU-instructions for your CPU (586 or 686 usually). Be careful with processor-specific instructions: I can only use MMX, anything higher does not work (I guess thats an OpenGL-related issue)

And: Use the Strip-All-Tool, or add the linker option -s. Then all unneeded parts are removed.

I have a file size of 700 kB, 200kB are grafics like icons, 500kB Code. And I have a lot of math code inside.

Though you are not interested in cross-platform now, you really should keep an eye on it. Its easy: just dont use any windows-specific code, dont include any “windows.h”. OpenGl is cross-platform,like GLUT, openGLUT, freeGLUT, FLTK, wxWidgets, GLUI, MESA, SDL, just to mention a few. If you only use own code and functions of such libs, you will be cross-platform. No additional work. Just compile on any other OS when needed.
You will have MUCH work translating a win32-window-creation to a KDE-window-creation for example.

Have much fun!

OK, no msn!

Well, I´ve downloaded FLTK, but didn´t know how to compile it…so I´m using Dev Pack … even not knowing how to do upgrades when necessary.

Well, about cross-plattaform, there´s an issue I spend some time thinking about…whitch is: who else is going to use it, since there´s a lot of GUI tools, some of them abandoned…

It´s something that makes me really sad about C/C++ over Java technology. Anyway…sometimes Java3D seems kinda promisse…I guess…and Java also allows to code OpenGL inside. Just a thought.

Well…yes, I really need help. Need to see at leat some functional sample of a just load, compile and run program using FLTK and OpenGL to keep my heart on C++ over Java. Working with both right now.

Well, the sample could be sent to my e-mail and I promisse I won´t reply unless you d´like me to.

tks a lot for the attention!

still looking forward for the fun!!!

Sorry, not much time today. Step-by-step will follow somewhen this week.

If you have installed the devpak properly, you should have a new template when starting a new project, its under the new “GUI” section and just called FLTK. Use this. Save to any folder and compile. You will get a “Hello World” example.

I hope this works so far, else you should check if all paths are correct (i once had a version where the fixed paths were set from the pak creator, which didn’t match mine)

I could mail you the pak i use if you wish.

Now to the FLUID: use it like a drawing program. The simple steps are to find in the Doc.
it will create you a .cxx and an apropriate .h file, with all you need :

new function
remove name (just read the hint why)
now put some buttons or something on the window
save (add extension .fl for later recognition)
do “write code”
this creates the .cxx and .h in the dir you saved before

Now start devcpp
new project, FLTK template
close the file without saving (not the project)
add files to project, choose the .cxx and .h FLUID made
now compile

hope this works

more will follow later

Hi jfk…thaks for beeing such a patience person! Honestly! Also, sorry about my terrible english! I’m from Brazil!

So…I did what you told me to, and wow…it worked! Yeap, some applications (from samples on the FLTK) didn’t…I could post you the error messages.

About FLUID…

  1. don’t know how to install it
  2. as I’ve been working with C++ about almost an year now, I consider myself a beginner. Don’t understand a thing about those “make” files people provide everywhere. Hope you could guide me thru.
    So…I didn’t know how to intall fluid.

I’d like to understand how to keep updating … even using wxDevC++, without always need to find some package…Cause I never know if it’s out of date or not! :slight_smile:

Thaks a lot…Sincerelly

Still little time, so this will be short:
No Problem with your english, as Im from Austria (not Australia)

As I understood you use the Bloodshed DevC++ Compiler, with the fltk-package installed by the included package manager.
If this is so, there is no need to install FLUID in any way, its already there:
take a look in the DevC++ install dir on your HD. It has a \bin\ subdir.
There is the fluid.exe and an Icon, so you can make a pretty link to this, or start it by simply double click on fluid.exe.

You can savely ignore make-files. You dont need them, DevCpp makes its own every time you click on compile.
I use the examples this way:
new project, FLTK template
save the project to the destination
close main.cxx WITHOUT saving
copy the needed file from the example to the destinaton (may be several .cxx and .h)
add all the files to the project (command under the project menu)
do “renew all” , not only compile when you change something, as changes in .h files may not be realized by the compiler
run the .exe

you might need some additional linker options when using opengl-stuff in your program:
make sure that under
project properties, Parameters
the linker options
-lfltk_gl -lglu32 -lopengl32
are there. If not, add them.

About Updating: FLTK has a really modern look (when you activate the “plastic” look, and lots of modern features, all in the stable 1.1.7 version. This version isnt updated, though i realized that sometimes “new” paks are in the list. I dont know the difference between them.

I dont do updating. I will update when FLTK 2.0 becomes stable, but its under heavy development at this time.

all the mentioned compiler commands may be named a bit different in english. I translated them from my german version myself. So dont be confused if you dont find the exact commands like “renew all”, I mean the icon with the four seperated gray squares (ctrl+F11)

Hi jfk

Yeah! It worked…fluid seems very nice and pretty! Also liked the ‘plastic’ theme! Thank you very much.

I’ll read its docs now work on a few samples … hope we could keep in touch. I’ll leave the choice to you!