Game Development Community

Jettison GLU: implement gluProject() and gluOrtho2D()

by Andy · in Torque Game Builder · 04/02/2007 (10:50 pm) · 0 replies

TGBP requires exactly 2 functions from the GLU library. Anyone that has stumbled through building TGBP on Linux is aware of the static vs. dynamic library linkage quirk on some Linux distros (some require a static link to -lGLU, others work OK with a dynamic link to -lGLU). See conf.UNIX.mk in the source tree for a curious note.

My suggestion: implement both routines somewhere in dgl and libGLU.a vs. libGLU.so stops being a problem.

gluProject():
[ sample implementation here: http://www.koders.com/c/fid80E904AD3DBFA04047BE2F1924F31D52FA5A362F.aspx?s=gluProject ]

gluOrtho2D():
[ sample implementation here:
http://www.koders.com/c/fid5B125A73E361A0F5574790F5DB501A8F64A93860.aspx?s=gluOrtho2D ]

Note that glOrtho2D(left, right, bottom, top) is equivalent to glOrtho(left, right, bottom, top, -1.0, 1.0).

Thanks.