Kohi Game Engine
standard_ui_system.h File Reference

The standard UI system is responsible for managing standard ui elements throughout the engine. This is an example of a retained-mode UI. More...

Go to the source code of this file.

Data Structures

struct  standard_ui_system_config
 The standard UI system configuration. More...
 
struct  standard_ui_renderable
 
struct  standard_ui_render_data
 
struct  sui_mouse_event
 
struct  sui_keyboard_event
 
struct  sui_clip_mask
 
struct  sui_control
 
struct  standard_ui_state
 

Typedefs

typedef struct standard_ui_system_config standard_ui_system_config
 The standard UI system configuration. More...
 
typedef struct standard_ui_renderable standard_ui_renderable
 
typedef struct standard_ui_render_data standard_ui_render_data
 
typedef struct sui_mouse_event sui_mouse_event
 
typedef enum sui_keyboard_event_type sui_keyboard_event_type
 
typedef struct sui_keyboard_event sui_keyboard_event
 
typedef struct sui_clip_mask sui_clip_mask
 
typedef struct sui_control sui_control
 
typedef struct standard_ui_state standard_ui_state
 

Enumerations

enum  sui_keyboard_event_type { SUI_KEYBOARD_EVENT_TYPE_PRESS , SUI_KEYBOARD_EVENT_TYPE_RELEASE }
 

Functions

KAPI b8 standard_ui_system_initialize (u64 *memory_requirement, standard_ui_state *state, standard_ui_system_config *config)
 Initializes the standard UI system. Should be called twice; once to get the memory requirement (passing state=0), and a second time passing an allocated block of memory to actually initialize the system. More...
 
KAPI void standard_ui_system_shutdown (standard_ui_state *state)
 Shuts down the standard UI system. More...
 
KAPI b8 standard_ui_system_update (standard_ui_state *state, struct frame_data *p_frame_data)
 
KAPI void standard_ui_system_render_prepare_frame (standard_ui_state *state, const struct frame_data *p_frame_data)
 
KAPI b8 standard_ui_system_render (standard_ui_state *state, sui_control *root, struct frame_data *p_frame_data, standard_ui_render_data *render_data)
 
KAPI b8 standard_ui_system_update_active (standard_ui_state *state, sui_control *control)
 
KAPI b8 standard_ui_system_register_control (standard_ui_state *state, sui_control *control)
 
KAPI b8 standard_ui_system_control_add_child (standard_ui_state *state, sui_control *parent, sui_control *child)
 
KAPI b8 standard_ui_system_control_remove_child (standard_ui_state *state, sui_control *parent, sui_control *child)
 
KAPI void standard_ui_system_focus_control (standard_ui_state *state, sui_control *control)
 
KAPI b8 sui_base_control_create (standard_ui_state *state, const char *name, struct sui_control *out_control)
 
KAPI void sui_base_control_destroy (standard_ui_state *state, struct sui_control *self)
 
KAPI b8 sui_base_control_load (standard_ui_state *state, struct sui_control *self)
 
KAPI void sui_base_control_unload (standard_ui_state *state, struct sui_control *self)
 
KAPI b8 sui_base_control_update (standard_ui_state *state, struct sui_control *self, struct frame_data *p_frame_data)
 
KAPI b8 sui_base_control_render (standard_ui_state *state, struct sui_control *self, struct frame_data *p_frame_data, standard_ui_render_data *render_data)
 
KAPI void sui_control_position_set (standard_ui_state *state, struct sui_control *self, vec3 position)
 Sets the position on the given control. More...
 
KAPI vec3 sui_control_position_get (standard_ui_state *state, struct sui_control *self)
 Gets the position on the given control. More...
 

Detailed Description

The standard UI system is responsible for managing standard ui elements throughout the engine. This is an example of a retained-mode UI.

Author
Travis Vroman (travi.nosp@m.s@ko.nosp@m.hieng.nosp@m.ine..nosp@m.com)
Version
1.0
Date
2023-09-21

Typedef Documentation

◆ standard_ui_render_data

◆ standard_ui_renderable

◆ standard_ui_state

◆ standard_ui_system_config

The standard UI system configuration.

◆ sui_clip_mask

typedef struct sui_clip_mask sui_clip_mask

◆ sui_control

typedef struct sui_control sui_control

◆ sui_keyboard_event

◆ sui_keyboard_event_type

◆ sui_mouse_event

Enumeration Type Documentation

◆ sui_keyboard_event_type

Enumerator
SUI_KEYBOARD_EVENT_TYPE_PRESS 
SUI_KEYBOARD_EVENT_TYPE_RELEASE 

Function Documentation

◆ standard_ui_system_control_add_child()

KAPI b8 standard_ui_system_control_add_child ( standard_ui_state state,
sui_control parent,
sui_control child 
)

◆ standard_ui_system_control_remove_child()

KAPI b8 standard_ui_system_control_remove_child ( standard_ui_state state,
sui_control parent,
sui_control child 
)

◆ standard_ui_system_focus_control()

KAPI void standard_ui_system_focus_control ( standard_ui_state state,
sui_control control 
)

◆ standard_ui_system_initialize()

KAPI b8 standard_ui_system_initialize ( u64 memory_requirement,
standard_ui_state state,
standard_ui_system_config config 
)

Initializes the standard UI system. Should be called twice; once to get the memory requirement (passing state=0), and a second time passing an allocated block of memory to actually initialize the system.

Parameters
memory_requirementA pointer to hold the memory requirement as it is calculated.
stateA block of memory to hold the state or, if gathering the memory requirement, 0.
configThe configuration (standard_ui_system_config) for this system.
Returns
True on success; otherwise false.

◆ standard_ui_system_register_control()

KAPI b8 standard_ui_system_register_control ( standard_ui_state state,
sui_control control 
)

◆ standard_ui_system_render()

KAPI b8 standard_ui_system_render ( standard_ui_state state,
sui_control root,
struct frame_data p_frame_data,
standard_ui_render_data render_data 
)

◆ standard_ui_system_render_prepare_frame()

KAPI void standard_ui_system_render_prepare_frame ( standard_ui_state state,
const struct frame_data p_frame_data 
)

◆ standard_ui_system_shutdown()

KAPI void standard_ui_system_shutdown ( standard_ui_state state)

Shuts down the standard UI system.

Parameters
stateThe state block of memory.

◆ standard_ui_system_update()

KAPI b8 standard_ui_system_update ( standard_ui_state state,
struct frame_data p_frame_data 
)

◆ standard_ui_system_update_active()

KAPI b8 standard_ui_system_update_active ( standard_ui_state state,
sui_control control 
)

◆ sui_base_control_create()

KAPI b8 sui_base_control_create ( standard_ui_state state,
const char *  name,
struct sui_control out_control 
)

◆ sui_base_control_destroy()

KAPI void sui_base_control_destroy ( standard_ui_state state,
struct sui_control self 
)

◆ sui_base_control_load()

KAPI b8 sui_base_control_load ( standard_ui_state state,
struct sui_control self 
)

◆ sui_base_control_render()

KAPI b8 sui_base_control_render ( standard_ui_state state,
struct sui_control self,
struct frame_data p_frame_data,
standard_ui_render_data render_data 
)

◆ sui_base_control_unload()

KAPI void sui_base_control_unload ( standard_ui_state state,
struct sui_control self 
)

◆ sui_base_control_update()

KAPI b8 sui_base_control_update ( standard_ui_state state,
struct sui_control self,
struct frame_data p_frame_data 
)

◆ sui_control_position_get()

KAPI vec3 sui_control_position_get ( standard_ui_state state,
struct sui_control self 
)

Gets the position on the given control.

Parameters
u_textA pointer to the control whose position will be retrieved.
Theposition of the given control.

◆ sui_control_position_set()

KAPI void sui_control_position_set ( standard_ui_state state,
struct sui_control self,
vec3  position 
)

Sets the position on the given control.

Parameters
selfA pointer to the control whose position will be set.
positionThe position to be set.