The UI coordinate system
Factor handbook » UI framework » Implementing new gadgets » Customizing gadget appearance » Implementing custom drawing logic

Prev:find-gl-context ( gadget -- )
Next:Subclassing worlds

The UI uses a coordinate system where the y axis is oriented down. The OpenGL GL_MODELVIEW matrix is saved or restored when rendering a gadget, and the origin is translated to the gadget's origin within the window. The current origin is stored in a variable:

Gadgets must not draw outside of their bounding box, however clipping is not enforced by default, for performance reasons. This can be changed by setting the clipped? slot to t in the gadget's constructor.