tags:

views:

59

answers:

2

Hey, i was reading opengl superbible, they were telling i can use the arrow keys to rotate the output and get a 3d view of the whole image but i dont seem to get it........ Any new functions needed to be invoked? Thanks in advance

A: 

First of all you have to understand the difference between the windowing library and the opengl context. In short, here is an overall summary.

OpenGL can be split in 2 parts:

  • The client
  • The driver

The client library is just a bunch of headers that you have to install. The driver is shipped with your graphic card.

The only thing that you can do is to manipulate an OpenGL context, that is, a set of buffers (frame buffers: color, depth, stencil, accumulation...) and states.

The context itself has no notion of "window" or "key". All it does is take some inputs, let it go through its pipeline, and save the output in frame buffers.

Next, there is the windowing system ( native ones: Win32, Cocoa, ..., or libraries built on top of it: Qt, GLFW, SDL, SFML, ... ) that provides windows, user input, drawings, etc... It is the windowing library that knows how to read OpenGL buffers and display them on screen.

So basically, all you have to do is to choose a windowing library, set up an OpenGL context, feed it with some inputs, and ask the window library to display the content on a canvas-like widget.

Give some more informations on what you're trying to do if you want more information.

Sides notes:

Aurélien Vallée
thank you sir for your answer, but i just stepped into the world of opengl and i am new 2 all these terminologies. But still i got a vague idea about it and i shall read a bit more and repost the query....Thank you for your valuable time......
codemax
accept the answer ;>
Aurélien Vallée
A: 

The OpenGL SuperBible doesn't bother including the entire program in the text of the book, just the pertenate code snippets that illuminate the topic at hand. Just download the complete source code at www.opengl.org/supperbible. Running these programs will give you the complete functionality described in the text of the book.

The OpenGL graphics library does not include user interaction functions such as moving the model with arrow keys. Another library or custom code is required to supply that functionality. The OpenGL SuperBible's sample programs use the GLUT library to supply user interaction functionality. The OpenGL SuperBible covers GLUT in addition to OpenGL, see chapter 2 for enough information on GLUT to understand the example programs.

Mr. Berna
Thank you sir for the link... i Really needed them.
codemax