00001 00005 // /** 00006 // *@defgroup renderh render.h 00007 // *Routines to queue objects in a list and draw them on screen in the order they arrived in the queue 00008 // *@{ 00009 // */ 00010 00011 /*----------------------------------------------------------------------------------------------------------*/ 00012 00013 #define RCOLOR(r, g, b, a) al_map_rgba(r, g, b, a) 00014 #define RDEFAULT al_map_rgba(255, 255, 255, 255) 00015 00016 /*----------------------------------------------------------------------------------------------------------*/ 00017 00018 typedef void(*RENDER_CALLBACK)(ALLEGRO_BITMAP*, float, float, int, ALLEGRO_COLOR); 00019 00020 /*----------------------------------------------------------------------------------------------------------*/ 00021 00022 typedef struct render_queue { 00023 ALLEGRO_BITMAP *image; 00024 float x; 00025 float y; 00026 int nflags; 00027 ALLEGRO_COLOR blend_color; 00028 RENDER_CALLBACK rcallb; 00029 struct render_queue *next; 00030 struct render_queue *prev; 00031 } RENDERQUEUE, *RENDERQUEUEPTR; 00032 00033 /*----------------------------------------------------------------------------------------------------------*/ 00034 00035 RENDERQUEUEPTR get_first_element_from_render_queue(void); 00036 00037 /*----------------------------------------------------------------------------------------------------------*/ 00038 00039 RENDERQUEUEPTR set_first_element_in_render_queue(RENDERQUEUEPTR *newfirst); 00040 00041 /*----------------------------------------------------------------------------------------------------------*/ 00042 00043 RENDERQUEUEPTR add_element_to_render_queue(ALLEGRO_BITMAP *image, float x, float y, int nflags, 00044 ALLEGRO_COLOR blendcol, RENDER_CALLBACK rcallback); 00045 00046 /*----------------------------------------------------------------------------------------------------------*/ 00047 00048 RENDERQUEUEPTR remove_element_from_render_queue(RENDERQUEUEPTR *currentptr); 00049 00050 /*----------------------------------------------------------------------------------------------------------*/ 00051 00052 void render(void); 00053 00054 /*----------------------------------------------------------------------------------------------------------*/ 00055 00056 _Bool empty_render_queue(RENDERQUEUEPTR rfirstptr); 00057 00058 /*----------------------------------------------------------------------------------------------------------*/ 00059 00060 void render_mouse_cursor(ALLEGRO_BITMAP *cursor); 00061 00062 /*----------------------------------------------------------------------------------------------------------*/ 00063 00064 // /** 00065 // *@} 00066 // */