Re: HOpenGL without GLUT

Sven Panne <[email protected]>
Newsgroups gmane.comp.lang.haskell.hopengl
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.