go to http://www.opengl.org/documentation/red_book_1.0/
and see for almost anything you wan't about opengl. I can write to you an example but i think it's better to tell you to see the red book.
and see for almost anything you wan't about opengl. I can write to you an example but i think it's better to tell you to see the red book.