[HOpenGL] HOpenGL without GLUT

Sven Panne Sven.Panne@informatik.uni-muenchen.de
Sat, 29 Mar 2003 14:31:26 +0100


C.Reinke wrote:
 > [...] Why do HOpenGL apps have to be that big (on win2k, the Klein
 > example gives me a 4Mb executable, which seems to be standard size for
 > non-trivial, but tiny, examples; even the Planet example gives about 1Mb,
 > on win2k)? [...]

To get executables of reasonable size, you have to do at least 2 things:

* Build all libraries with --split-objs, otherwise using a single entity
   from a module pulls in *all* code from the module (in a transitive
   fashion!). Failing to do so almost always results in executables which
   contain the whole GL/GLU/GLUT binding.

* Strip the executables after building. This e.g. cuts down the size by
   half on Linux, measured for a few simple programs.

The size of the executables for the "Hello" and "Smooth" examples are then
184kB and 195kB, respectively (x86-Linux, GHC and OpenGL/GLUT packages from
CVS HEAD). This is not that bad, given the 148kB of a "Hello, world!"
one-liner...

Cheers,
    S.