operating system library or graphic card library


Do be patient with me, coz Im still picking up. I’ve been looking at other GL toolkits other than GLUT to try understand.

What I understand is these toolkits just makes life easier for windows and inputs.

Here is a question:-
When we use functions like

Are we actually invoking a Windows XP or Graphic Card related library? How come Microsoft has documentation on glRotatef as well?

And is Microsoft stilll supporting OpenGL?

openGL is a high performance graphics library developed by SGI (silicon graphics). It uses video hardware to do the rendering so this makes it very fast. Comparatively speaking openGL is quite an old standard and so it is supported by almost all video hardware and it runs on almost every type of computer (Windows, Linux, OS X even a PSP).

openGL works by sending your programs drawing commands to the graphics card - which is like a mini computer that is optimized just for graphics related operations. This frees up the cpu which wouldn’t be able to perform the operations as fast.

so glRotatef has the effect of:

  1. computer is like “oh this is an openGL command”
  2. computer sends the command glRotatef to the graphics card
  3. the graphics card then performs the rotation
  4. after all the openGL calls are executed the ‘view’ is rendered to the screen.

Microsoft supports openGL but they also try and push their DirectX graphics library which is now also supported on a lot of graphics cards.

GLUT provides a window that openGL can render into, openGL just handles the task of rendering. It doesn’t provide a window or any other nice perks. Each operating system (linux, mac etc) has their own way of making a window and so the code to open a window, resize it, get mouse events, get key presses etc… has to be implemented in a different way for each operating system.

So while the code for moving a window on OS X will look completely different than the code to move a window on Windows XP GLUT lets you do it with the same command no matter what platform you are on:

glutPositionWindow(int x, int y);  

Hope that is clear :slight_smile:

Hello Theo,

Thanks for the explanation. It makes noobs like me understand quite well.

I just stumbled upon GLFW.

What is the difference between GLFW and GLUT? :smiley:

Not too much actually - we were using glfw for a while before the first openFrameworks release. Both have their own advantages and disadvantages. There was a reason why we switched back to glut though.