Draw in OpenGL

Print Friendly, PDF & Email

How to compile a program written in OpenGL

g++ -Wall -O my-program.cpp -lglut -o my-program
In which:

  • -Wall: is a way of saying the compiler that it should output all the warnings
  • -O: says the compiler to use some optimization techniques
  • -l is a linker option stating to include the library followed the -l. Here is glut.

    There is a little extra advantage when using GLUT, if you were developing an OpenGL application you should include the header files gl.h and glu.h (glu is the OpenGL Utility Library) but when you are including glut.h, glut.h guarantees the inclusion of gl.h and glu.h. So when we start and OpenGL application we start by writing:


  • -o: says the compiler that it should produce a binary file whose name is my-program

An Efficient Way to Draw Approximate Circles in OpenGL
An introduction of GLUT (Understand easily)

Draw Text
Faster Text in OpenGL
Drawing Text

One thought on “Draw in OpenGL

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *



Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.