Kohi Game Engine
|
A global handle system for Kohi. Handles are used to obtain various resources using a unique handle id. More...
Go to the source code of this file.
Data Structures | |
struct | khandle |
A handle is a unique identifier used a system in the engine to avoid using raw pointers where possible. More... | |
struct | khandle16 |
Macros | |
#define | INVALID_khandle INVALID_ID_U64 |
Typedefs | |
typedef struct khandle | khandle |
A handle is a unique identifier used a system in the engine to avoid using raw pointers where possible. More... | |
typedef struct khandle16 | khandle16 |
Functions | |
KAPI khandle | khandle_create (u32 handle_index) |
Creates and returns a handle with the given handle index. Also creates a new unique identifier. More... | |
KAPI khandle | khandle_create_with_identifier (u32 handle_index, identifier id) |
Creates and returns a handle based on the handle index and identifier provided. More... | |
KAPI khandle | khandle_create_with_u64_identifier (u32 handle_index, u64 uniqueid) |
Creates and returns a handle based on the handle index provided, using the given u64 to create an identifier. More... | |
KAPI khandle | khandle_invalid (void) |
Creates and returns an invalid handle. More... | |
KAPI b8 | khandle_is_valid (khandle handle) |
Indicates if the provided handle is valid. More... | |
KAPI b8 | khandle_is_invalid (khandle handle) |
Indicates if the provided handle is invalid. More... | |
KAPI void | khandle_invalidate (khandle *handle) |
Invalidates the provided handle. More... | |
KAPI b8 | khandle_is_stale (khandle handle, u64 uniqueid) |
Indicates if the handle is stale/outdated). More... | |
KAPI b8 | khandle_is_pristine (khandle handle, u64 uniqueid) |
Indicates if the handle is pristine (i.e. not stale/outdated). More... | |
KAPI khandle16 | khandle16_create (u16 handle_index) |
Creates and returns a handle with the given handle index. Also creates a new unique identifier. More... | |
KAPI khandle16 | khandle16_create_with_u16_generation (u16 handle_index, u16 generation) |
Creates and returns a handle based on the handle index provided, using the given u64 to create an identifier. More... | |
KAPI khandle16 | khandle16_invalid (void) |
Creates and returns an invalid handle. More... | |
KAPI b8 | khandle16_is_valid (khandle16 handle) |
Indicates if the provided handle is valid. More... | |
KAPI b8 | khandle16_is_invalid (khandle16 handle) |
Indicates if the provided handle is invalid. More... | |
KAPI void | khandle16_update (khandle16 *handle) |
Updates the provided handle, incrementing the generation. More... | |
KAPI void | khandle16_invalidate (khandle16 *handle) |
Invalidates the provided handle. More... | |
KAPI b8 | khandle16_is_stale (khandle16 handle, u16 uniqueid) |
Indicates if the handle is stale/outdated). More... | |
KAPI b8 | khandle16_is_pristine (khandle16 handle, u16 uniqueid) |
Indicates if the handle is pristine (i.e. not stale/outdated). More... | |
A global handle system for Kohi. Handles are used to obtain various resources using a unique handle id.
#define INVALID_khandle INVALID_ID_U64 |
A handle is a unique identifier used a system in the engine to avoid using raw pointers where possible.
khandle16 - a 16-bit implementation of the khandle that uses one u16 for the index and a second for the uniqueid. This results in a much smaller handle, although coming with a limitation of a maximum of 65534 values (65535 is INVALID_ID_U16) as a maximum array size for anything this references.
Creates and returns a handle with the given handle index. Also creates a new unique identifier.
Creates and returns a handle based on the handle index provided, using the given u64 to create an identifier.
Indicates if the handle is pristine (i.e. not stale/outdated).
Indicates if the handle is stale/outdated).
Updates the provided handle, incrementing the generation.
Creates and returns a handle with the given handle index. Also creates a new unique identifier.
KAPI khandle khandle_create_with_identifier | ( | u32 | handle_index, |
identifier | id | ||
) |
Creates and returns a handle based on the handle index and identifier provided.
Creates and returns a handle based on the handle index provided, using the given u64 to create an identifier.
Indicates if the handle is pristine (i.e. not stale/outdated).
Indicates if the handle is stale/outdated).