A display list is a list that contains commands to be executed every frame. Commands in a list are execurted sequentially in the order of insertion. Internally each display list contains a heap which may change when the list enlarges that why display list commands MUST NOT use pointers to something inside the command data (in the heap). Display lists are thread safe.
The display list execution occurs in two passes :
There is two types of display list :
The display list system will only executes main-lists. As the order display list execution order is indetermined, the graphic context should be set at the beginning of each main-list. Anyway it is resetted to default values before each main-list execution.
Sub-lists could be executed via the sub-list command from either a main-list or another sub-list.
benjamin gerard
Files | |
| file | display_list.h |
| thread safe display list support for dcplaya | |
Data Structures | |
| struct | dl_context_t |
| Display list render context. More... | |
| struct | dl_runcontext_t |
| Display list run context. More... | |
| struct | dl_command_t |
| Display list command header structure. More... | |
| struct | dl_list |
| Display list structure. More... | |
| struct | dl_heap_transfert_t |
| Heap transfert struct. More... | |
Display list flags. | |
| #define | DL_INHERIT_PARENT 0 |
| effective = parent | |
| #define | DL_INHERIT_LOCAL 1 |
| effective = local | |
| #define | DL_INHERIT_ADD 2 |
| effective = parent+local | |
| #define | DL_INHERIT_MUL 3 |
| effective = parent*local | |
Display list system initialization. | |
| int | dl_init (void) |
| Initialize the display list system. | |
| int | dl_shutdown (void) |
| Shutdown the display list system. | |
Display list management. | |
| dl_list_t * | dl_create (int heapsize, int active, int sub, const char *name) |
| Create a new display list. | |
| void | dl_destroy (dl_list_t *dl) |
| Destroy the given display list (Does not ckeck the reference count. | |
| void | dl_reference (dl_list_t *dl) |
| Reference a display list. | |
| int | dl_dereference (dl_list_t *dl) |
| Dereference a display list and destroy it if there is no more reference on it. | |
Display list control. | |
| int | dl_get_active (dl_list_t *dl) |
| Query active state of given display list. | |
| int | dl_set_active (dl_list_t *dl, int active) |
| Change active state of a display list. | |
| int | dl_set_active2 (dl_list_t *l1, dl_list_t *l2, int active) |
| Change active state of two display list. | |
Display list command functions. | |
| Set of function of creating and removing display list commands. How to add a command to a display list :
| |
| void * | dl_alloc (dl_list_t *dl, size_t size) |
| Allocate requested number of byte in the display list heap and keep display list locked until dl_insert() function call. | |
| dl_comid_t | dl_insert (dl_list_t *dl, void *pcom, dl_command_func_t o_render, dl_command_func_t t_render) |
| Insert the given command into the display list. | |
| void | dl_clear (dl_list_t *dl) |
| Clear the display list (i.e. | |
| dl_comid_t | dl_nop_command (dl_list_t *dl) |
| Insert an NO-OPERATION command to display list. | |
| dl_comid_t | dl_sublist_command (dl_list_t *dl, dl_list_t *sublist, const dl_runcontext_t *rc) |
| Insert an SUB-LIST command to display list. | |
Display list rendering functions. | |
| These functions must be call by the rendering thread to perform display list rendering process in a given mode. | |
| void | dl_render_opaque (void) |
| Render all active display list in opaque mode. | |
| void | dl_render_transparent (void) |
| Render all active display list in transparent mode. | |
Display list context access. | |
| void | dl_set_trans (dl_list_t *dl, const matrix_t mat) |
| Set display list global transformation. | |
| float * | dl_get_trans (dl_list_t *dl) |
| Get display list global transformation. | |
| void | dl_set_color (dl_list_t *dl, const dl_color_t *col) |
| Set display list global color. | |
| dl_color_t * | dl_get_color (dl_list_t *dl) |
| Get display list global color. | |
Defines | |
| #define | DL_COMID_ERROR -1 |
| Constant for errorneous dl_comid_t. | |
Typedefs | |
| typedef draw_color_t | dl_color_t |
| Display list color type. | |
| typedef draw_clipbox_t | dl_clipbox_t |
| Display list clipping box type. | |
| typedef dl_code_e(* | dl_command_func_t )(void *, dl_context_t *) |
| Function type to render in opaque list or transparent list ; its argument is the pointer on the command that contained it. | |
| typedef int | dl_comid_t |
| Display list command identifier. | |
| typedef dl_list | dl_list_t |
| Display list structure. | |
Enumerations | |
| enum | dl_code_e { DL_COMMAND_OK = 0, DL_COMMAND_BREAK = 1, DL_COMMAND_SKIP = 2, DL_COMMAND_ERROR = -1 } |
| Display list command error codes enumeration. More... | |
Functions | |
| typedef | LIST_HEAD (dl_lists, dl_list) dl_lists_t |
|
|
Display list command error codes enumeration.
|
|
||||||||||||||||||||
|
Create a new display list.
|
|
|
Destroy the given display list (Does not ckeck the reference count.
|
|
|
Reference a display list.
|
|
|
Dereference a display list and destroy it if there is no more reference on it.
|
|
|
Query active state of given display list.
|
|
||||||||||||
|
Change active state of a display list.
|
|
||||||||||||||||
|
Change active state of two display list. The dl_set_active2() is an atomic function for changing the active state of two diaply list. It is very useful to perform a double-buffering emulation.
|
|
||||||||||||
|
Allocate requested number of byte in the display list heap and keep display list locked until dl_insert() function call.
|
|
||||||||||||||||||||
|
Insert the given command into the display list.
|
|
|
Clear the display list (i.e. reset the command list)
|
|
|
Insert an NO-OPERATION command to display list.
|
|
||||||||||||||||
|
Insert an SUB-LIST command to display list.
|
|
||||||||||||
|
Set display list global transformation.
|
|
|
Get display list global transformation.
|
|
||||||||||||
|
Set display list global color.
|
|
|
Get display list global color.
|
| dcplaya documentation version 1.2 | Generated on January 2004 by doxygen 1.3.5 |