Pages

Thursday, August 27, 2009

Draw in OpenGL

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:

    #include
  • -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

1 comment:

  1. http://users.encs.concordia.ca/~grogono/Graphics/examples.html

    Graphics Examples

    ReplyDelete