Why OpenGL

Hi Guys,

I must admit that I am very new to OpenGL. But I have been doing C++ and a bit of Flash.

Hope you guys can share with me why people are still using GLUT/GLUI/FreeGLUT, despite it has not been updated for so many years?

So why do you like OpenGL?

Im open to hear your point of view

to be honest, we use glut because it’s ubiquitous, but we aren’t in love with it. the fact that it’s around everywhere, means that people really understand it, there are plenty of books and the bugs/quirks are really well known. also it’s pretty easy to use / get your head around the api. the difficulty of using another windowing toolkit is, either

(a) picking one that has a huge API like (ogre, irrlicht, sdl, etc)
(b) lesser known (or less documented) like glfw, cpw
© picking one that isn’t oriented completely around graphics like wxwindows

the downsides (a,b,c) for us outweight the plusses, but we have plans to abstract a bit of the glut stuff in the OF code so that windowing toolkits could be swapped. several folks are working on that (getting OF on top of SDL) right now, so it may be that soon you can have more choices. For beginners glut is really good because there is alot of glut code around to plug in and get up and running. also, if you want to hack the OF code, it’s pretty easy to find the info about the glut calls that are being made.

This is part of the decision making process we’ve been in : support the beginner, even if that means some non-optimal techniques or libs. for example, we treat all images are RGB in every CPU, even though in reality on intel chips it’s BGR. This was a decision to make it easier to hack code and not have to worry about what platform the code is running on. Obviously non-optimal, but super helpful for beginners.

at some point soon, we might start branches for experimental versions of OF, like OF on top of different windowing platforms, OF super optimized, etc.

it’s true glut hasn’t been updated in *forever* and it’s buggy. recently I was cursing it because it doesn’t support FSAA. But at the same time, it generally works and we’ve been running with it for a while – it would be a bit harder to support a windowing toolkit we don’t know well across all platfroms / compilers.

about GL - it’s really good. there are some quirky problems, but I like it much more then directx. In fact, I hate most microsoft libraries for very obvious reasons… not to be a hater but we are all about opensource, and open standards. the opengl community is strong and there is alot of good information and resources out there.

hope that helps !

Actually, I find that openGL has better forums. Although most are not updated for many years.

So are you guys thinking of doing more 3d stuff or 2d here?

Im on windows platform, I find that many 3d examples cant run on my PC.

What is your advice for me if I wish to use OpenGL on Windows?

yeah the forums are better, I usually go to gamedev.net and opengl.org to start.

we tend to be more about 2d, but 3d is supported. the issue you have is that alot of opengl example tend to be oriented around a very small coordinate system. our coordinate system is pixel oriented for objects on the z = 0 plane (ie, if you say rect(40,40,100,100) it will start at pixel 40,40).

in contrast, this example from nehe:

uses a coordinate system *very* close to 0,0,0… for example:

glColor3f(1.0f,0.0f,0.0f);			// Red  
glVertex3f( 0.0f, 1.0f, 0.0f);			// Top Of Triangle (Front)  
glColor3f(0.0f,1.0f,0.0f);			// Green  
glVertex3f(-1.0f,-1.0f, 1.0f);			// Left Of Triangle (Front)  
glColor3f(0.0f,0.0f,1.0f);			// Blue  
glVertex3f( 1.0f,-1.0f, 1.0f);			// Right Of Triangle (Front)  

in our system would be only one pixel big !

the other issue is that our 0,0 position is the top right corner (like flash or p5). This is different then some setups, like nehe, where the 0,0 is in the center.

all these things can be fixed, just be altering values or calling opengl transformation routines, like glTranslatef, glScalef, etc.

for example:

glColor3f(1.0f,0.0f,0.0f);			// Red  
glVertex3f( 2000f, 300.0f, 200.0f);			// Top Of Triangle (Front)  
glColor3f(0.0f,1.0f,0.0f);			// Green  
glVertex3f(100.0f,100.0f, 300.0f);			// Left Of Triangle (Front)  
glColor3f(0.0f,0.0f,1.0f);			// Blue  
glVertex3f( 300.0f,100.0f, 300.0f);			// Right Of Triangle (Front)  

hope that helps - if you have an example you are having trouble with feel free to post it here –

take care !