#ifndef GFX_H #define GFX_H #include "libsys.h" #define GFX_NUM_FRAME_BUFFERS 2 #define GFX_FRAME_NOSYNC 0 #define GFX_FRAME_SYNC 1 // ------------------------------------------------------------- // Types // ------------------------------------------------------------- typedef struct _sbox_t { UINT32 w, h; UINT32 *pSave; } box_t; typedef struct _srect_t { UINT32 xmin, xmax; UINT32 ymin, ymax; } rect_t; typedef struct _sbuf_t { UINT32 *pFB; struct _sbuf_t *pNext; struct _sbuf_t *pLast; UINT32 is_dirty; rect_t rect; UINT32 w, h; } buf_t; typedef struct _sgfx_t { UINT32 w, h; buf_t *pBuf; UINT32 *pBG; } gfx_t; // ------------------------------------------------------------- // Functions // ------------------------------------------------------------- void __gfx_block_set_8(UINT32* pDst, UINT32 value); void __gfx_block_copy_8(UINT32* pDst, UINT32* pSrc); void __gfx_copy_32(UINT32* pDst, UINT32* pSrc, UINT32 nblocks); void GFX_init(gfx_t *pObj); void GFX_frame(gfx_t *pObj, UINT32 sync_mode); void GFX_show(gfx_t *pObj); void GFX_copy_front2back(gfx_t *pObj); void GFX_copy_back2front(gfx_t *pObj); void GFX_get_FB_front(gfx_t *pObj, UINT32 **ppFB); void box_create(box_t *pObj, UINT32 w, UINT32 h); void GFX_save(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy); void GFX_restore(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy); void GFX_box_draw(gfx_t *pObj, box_t *pBox, UINT32 posx, UINT32 posy, UINT32 color); #endif // GFX_H