GL Driver

This driver represents a driver for drawing using OpenGL. The implementation uses the OpenGL functions only. For the font support, this driver uses the FTGL API functions, which it was written against the Free Type library.

The driver is not dependent of system functions. It uses only the OpenGL portable functions. So if the window canvas changes its size the attribute "SIZE" must be set with the new size or cdCanvasGetSize will return an incorrect value.

Use

The canvas is created by means of a call to the function cdCreateCanvas(CD_GL, Data), after which other functions in the CD library can be called as usual. The Data parameter string has the following format:

"widthxheight [resolution]"      in C "%dx%d %g"

It must include the initial canvas' dimensions. Width and height are provided in pixels (note the lowercase "x" between them). The resolution is optional, its default value is "3.78 pixels/mm" (96 DPI).

To use this driver, the application must be linked with the "cdgl", the ftgl library and the OpenGL library. The FTGL library is dependent also on the GLU library. In UNIX cdgl is also dependent on iconv.

In Lua, it is necessary to call function cdluagl_open() after a call to function cdlua_open(), apart from linking with the "cdluagl" library. This is not necessary if you do require"cdluagl". 

Behavior of Functions

Control 

Coordinate System and Clipping

Primitives

Client Images

Attributes

Colors

Exclusive Attributes