]> git.bts.cx Git - benzene.git/blob - src/bz/gfx/draw_queue.h
Fixed Aseprite rendering system
[benzene.git] / src / bz / gfx / draw_queue.h
1 #ifndef BZ_GFX_DRAW_QUEUE_H
2 #define BZ_GFX_DRAW_QUEUE_H
3
4 #include <bz/memory/arena.h>
5 #include <bz/types/common.h>
6
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 typedef struct BZDrawQueue BZDrawQueue;
12 typedef BZDrawQueue * BZDrawQueueID;
13
14 typedef void (*BZDrawQueueCall)(void *userParameter);
15 typedef void (*BZDrawQueueSortFunction)(void);
16
17 extern BZDrawQueueID bzGfxDrawQueueCreate(BZMemoryArenaID arena, const char *identifierFmt, ...);
18 extern void bzGfxDrawQueueTeardown(BZDrawQueueID drawQueue);
19
20 extern void bzGfxDrawQueueSetSortFunction(BZDrawQueueID drawQueue, BZDrawQueueSortFunction sortFunction); // FIXME, use this for map thing.
21
22 extern size_t bzGfxDrawQueueEnqueuedInstructionCount(BZDrawQueueID drawQueue);
23
24 extern void bzGfxDrawQueueClear(BZDrawQueueID drawQueue);
25 //extern void bzGfxDrawQueueEnqueue(BZDrawQueueID drawQueue, BZRect cullRect, BZDrawQueueCall drawCall, void *userParameter);
26 //extern BZMemoryArenaID bzGfxDrawQueueEnqueueExt(BZDrawQueueID drawQueue, uint8_t sortIdx, BZDrawQueueCall drawCall);
27 //extern void bzGfxDrawQueueEnqueue(BZDrawQueueID drawQueue, uint8_t sortIdx, BZDrawQueueCall drawCall, size_t userParameterSize, void *userParameter);
28 extern void *bzGfxDrawQueueEnqueue(BZDrawQueueID drawQueue, uint8_t sortIdx, BZDrawQueueCall drawCall, size_t userParameterSize);
29
30 extern void bzGfxDrawQueueRun(BZDrawQueueID drawQueue);
31 extern void bzGfxDrawQueueRunSortBin(BZDrawQueueID drawQueue, uint8_t sortIdx);
32
33 #ifdef __cplusplus
34 }
35 #endif
36
37 #endif