|
Banjo API 0.0.1
C99 game development API
|
Enumerations | |
| enum | bj_system { BJ_NO_SYSTEM = 0x00 , BJ_AUDIO_SYSTEM = 0x01 , BJ_VIDEO_SYSTEM = 0x02 } |
Functions | |
| bj_bool | bj_begin (int systems, struct bj_error **error) |
| void | bj_end (void) |
| bj_bool | bj_begin_system (enum bj_system system, struct bj_error **error) |
| void | bj_end_system (enum bj_system system, struct bj_error **error) |
| void * | bj_load_library (const char *path) |
| void | bj_unload_library (void *handle) |
| void * | bj_library_symbol (void *handle, const char *name) |
Abstraction to usual system calls such as library loading and time.
| enum bj_system |
Initializes the system.
| systems | An OR combination of bj_system to initialize. |
| error | An optional location to an error object. |
The initialization process will iteratively try to initialize a subsystem among the ones available and returns on the first that succeeded.
Initializes a single system with reference counting.
| system | A single bj_system value to initialize. |
| error | An optional location to an error object. |
This function retains the specified system, incrementing its reference count. Time and event subsystems are always retained as dependencies. Multiple calls to this function must be balanced with matching calls to bj_end_system.
| void bj_end | ( | void | ) |
De-initializes the system.
This function forcefully shuts down all subsystems and resets all reference counts to zero, regardless of how many times they were retained. Errors during shutdown are ignored.
De-initializes a single system with reference counting.
| system | A single bj_system value to release. |
| error | An optional location to an error object. |
This function releases the specified system, decrementing its reference count. Time and event subsystems are also released. When a system's reference count reaches zero, it is fully shut down.
| void * bj_library_symbol | ( | void * | handle, |
| const char * | name ) |
Get the address of a function exported by handle given its name.
This function is an abstraction over the platform specific function like dlsym and GetProcAddress.
| handle | A library handle provided by bj_load_library. |
| name | C-String name of the function to retrieve |
The caller is responsible for release the loaded function using bj_unload_library with handle.
| void * bj_load_library | ( | const char * | path | ) |
Load the provided dynamic library and returns and opaque handle to it.
This function is an abstraction over the platform specific function like dlopen and LoadLibrary. The provided pointer can be used with bj_library_symbol to get a function from the loaded library.
| path | A C-string path to the library to load. |
The caller is responsible for release the loaded library using bj_unload_library.
| void bj_unload_library | ( | void * | handle | ) |
Unload a library loaded with bj_load_library from memory.
This function is an abstraction over the platform specific function like dlclose and FreeLibrary.
| handle | The library to unload. |
The caller is responsible for release the loaded library using bj_unload_library.