24 #ifndef __GFX_UTILS_H__
25 #define __GFX_UTILS_H__
void * rbuf_handle_t
A handle to a ring buffer object, created using gfxRbufInit()
Definition: gfx_utils.h:93
void gfxRbufReset(rbuf_handle_t rbuf)
Resets the ring buffer to it's initial state.
Definition: gfx_utils.c:322
char * gfxUtilPrependPath(const char *path, char *file)
Prepends a path string to a filename.
Definition: gfx_utils.c:79
size_t gfxRbufCapacity(rbuf_handle_t rbuf)
Returns the maximum number of elements that the ring buffer can store.
Definition: gfx_utils.c:492
int gfxRbufPut(rbuf_handle_t rbuf, void *data)
Fills the next available buffer slot, if a slot is free.
Definition: gfx_utils.c:352
char * gfxUtilFindResourcePath(char *resource_name)
Similar to gfxUtilFindResource() only returning the file's path instead of the opened FILE's referenc...
Definition: gfx_utils.c:207
char * gfxUtilGetBinFolderPath(char *bin_path)
Gets the execution folder of the current program, assumes that program is executing from a folder "bi...
Definition: gfx_utils.c:93
void gfxUtilSetGLThread(void)
The calling thread is registered as holding the current GL context.
Definition: gfx_utils.c:72
void gfxRbufFree(rbuf_handle_t rbuf)
Frees a ring buffer.
Definition: gfx_utils.c:311
int gfxRbufGet(rbuf_handle_t rbuf, void *data)
Returns a copy of the next buffer item's data.
Definition: gfx_utils.c:425
FILE * gfxUtilFindResource(char *resource_name, const char *mode)
Searches for a file in the RESOURCES_DIRECTORY and returns a FILE * if found.
Definition: gfx_utils.c:193
rbuf_handle_t gfxRbufInit(size_t item_size, size_t item_count)
Initialized a ring buffer object with a certain number of objects of a given size.
Definition: gfx_utils.c:257
int gfxRbufPutBuffer(rbuf_handle_t rbuf)
Used when a reference to the next buffer item is already filled, incrementing the next buffer item sh...
Definition: gfx_utils.c:338
const char * gfxUtilFindResourceDirectory(void)
Returns the lopcation of the resource directory.
Definition: gfx_utils.c:177
int gfxRbufFPut(rbuf_handle_t rbuf, void *data)
Fills the next available buffer, overwriting data if the ring buffer is full.
Definition: gfx_utils.c:376
unsigned char gfxRbufFull(rbuf_handle_t rbuf)
Checks if the buffer is full.
Definition: gfx_utils.c:459
rbuf_handle_t gfxRbufInitStatic(size_t item_size, size_t item_count, void *buffer)
Initialized a ring buffer object with a certain number of objects of a given size into a statically a...
Definition: gfx_utils.c:284
int gfxUtilIsCurGLThread(void)
Checks if the calling thread is the thread that currently holds the GL context.
Definition: gfx_utils.c:61
size_t gfxRbufSize(rbuf_handle_t rbuf)
Returns the number of elements currently stored in the ring buffer.
Definition: gfx_utils.c:471
unsigned char gfxRbufEmpty(rbuf_handle_t rbuf)
Checks if the buffer is empty or not.
Definition: gfx_utils.c:448
void * gfxRbufGetBuffer(rbuf_handle_t rbuf)
Returns a reference to the data of the next ring buffer entry.
Definition: gfx_utils.c:397