Main Page   Modules   File List   Globals  

Basic functions


Functions

int caca_init (void)
void caca_set_delay (unsigned int)
 Set the refresh delay. More...

enum caca_feature caca_get_feature (enum caca_feature)
void caca_set_feature (enum caca_feature)
char const * caca_get_feature_name (enum caca_feature)
unsigned int caca_get_rendertime (void)
 Get the average rendering time. More...

unsigned int caca_get_width (void)
unsigned int caca_get_height (void)
int caca_set_window_title (char const *)
 Set the window title. More...

unsigned int caca_get_window_width (void)
 Get the window width. More...

unsigned int caca_get_window_height (void)
 Get the window height. More...

void caca_refresh (void)
 Flush pending changes and redraw the screen. More...

void caca_end (void)

Detailed Description

These functions provide the basic libcaca routines for library initialisation, system information retrieval and configuration.

Function Documentation

unsigned int caca_get_rendertime void   
 

This function returns the average rendering time, which is the average measured time between two caca_refresh() calls, in microseconds. If constant framerate was activated by calling caca_set_delay(), the average rendering time will not be considerably shorter than the requested delay even if the real rendering time was shorter.

Returns:
The render time in microseconds.

unsigned int caca_get_window_height void   
 

If libcaca runs in a window, get the usable window height. This value can be used for aspect ratio calculation. If libcaca does not run in a window or if there is no way to know the font size, assume a 6x10 font is being used. Note that the units are not necessarily pixels.

Returns:
The window height.

unsigned int caca_get_window_width void   
 

If libcaca runs in a window, get the usable window width. This value can be used for aspect ratio calculation. If libcaca does not run in a window or if there is no way to know the font size, assume a 6x10 font is being used. Note that the units are not necessarily pixels.

Returns:
The window width.

void caca_refresh void   
 

This function flushes all graphical operations and prints them to the screen. Nothing will show on the screen until caca_refresh() is called.

If caca_set_delay() was called with a non-zero value, caca_refresh() will use that value to achieve constant framerate: if two consecutive calls to caca_refresh() are within a time range shorter than the value set with caca_set_delay(), the second call will wait a bit before performing the screen refresh.

void caca_set_delay unsigned int    usec
 

This function sets the refresh delay in microseconds. The refresh delay is used by caca_refresh() to achieve constant framerate. See the caca_refresh() documentation for more details.

If the argument is zero, constant framerate is disabled. This is the default behaviour.

Parameters:
usec  The refresh delay in microseconds.

int caca_set_window_title char const *    title
 

If libcaca runs in a window, try to change its title. This works with the X11 and Win32 drivers.

Parameters:
title  The desired window title.
Returns:
0 upon success, a non-zero value if an error occurs.