News | About | Download | Documentation | Development | Links
Displaying 2D graphics, setting the video mode and drawing on the screen are very basic features of any game. The ClanLib 2D api provides support for this and several other things, including:
ClanDisplay is divided into several classes.
Note that input is part of the display component in ClanLib, there is no separate ClanInput. The input API and its classes are explained in a separate documentation overview.
Here is a short overview over the most important display classes:
The display class provides a static function interface to CL_DisplayWindow and other display classes. It uses a selected display window (by default the first created window) to call the equivalent functions in CL_DisplayWindow, CL_GraphicContext and such.
The entire point of this is to allow applications with only one window to not pass around a pointer to the display window.
CL_DisplayWindow represents a window in your windowing system (Windows, X11). You need to create at least one display window in order to draw graphics in ClanLib.
A graphic context is something that ClanLib can render onto, for examples a CL_DisplayWindow, CL_Canvas or CL_PixelBuffer.
An input context is a collection of inputdevices available in a displaywindow.
Pixel data access.
Pixel data format description.
A surface is an image you can draw to the display, having support for scaling, rotation, alignment and more.
The Canvas class is a special surface that is optimized for rapid changes in its pixel data. This is opposite to CL_Surface, which is optimized for no changes in its pixel data.
A texture is just a simple texture, nice for use in 3D application.
Font makes it possible to write text to a displaywindow, with support for scaling, rotation, alignment, and more.
Animated sprites with CL_Sprite is both easy, and very powerful.