Kohi Game Engine
editor.h File Reference
#include "kui_types.h"
#include <core/frame_data.h>
#include <core/keymap.h>
#include <kui_system.h>
#include <platform/platform.h>
#include <renderer/kforward_renderer.h>
#include <world/world_types.h>
#include "editor/editor_gizmo.h"

Go to the source code of this file.

Data Structures

struct  keditor_gizmo_pass_render_data
 
struct  keditor_gizmo_pass_data
 
struct  editor_state
 

Macros

#define EDITOR_AXIS_COLOUR_R    (colour4){1.0f, 0.5f, 0.5f, 1.0f}
 
#define EDITOR_AXIS_COLOUR_G    (colour4){0.5f, 1.0f, 0.5f, 1.0f}
 
#define EDITOR_AXIS_COLOUR_B    (colour4){0.5f, 0.5f, 1.0f, 1.0f}
 

Typedefs

typedef struct keditor_gizmo_pass_render_data keditor_gizmo_pass_render_data
 
typedef enum editor_mode editor_mode
 
typedef struct keditor_gizmo_pass_data keditor_gizmo_pass_data
 
typedef struct editor_state editor_state
 

Enumerations

enum  editor_mode { EDITOR_MODE_SCENE , EDITOR_MODE_ENTITY , EDITOR_MODE_TREE , EDITOR_MODE_ASSETS }
 

Functions

KAPI b8 editor_initialize (u64 *memory_requirement, struct editor_state *state)
 
KAPI void editor_shutdown (struct editor_state *state)
 
KAPI b8 editor_open (struct editor_state *state, kname scene_name, kname scene_package_name)
 
KAPI b8 editor_close (struct editor_state *state)
 
KAPI void editor_set_mode (struct editor_state *state, editor_mode mode)
 
KAPI void editor_clear_selected_entities (struct editor_state *state)
 
KAPI void editor_select_entities (struct editor_state *state, u32 count, kentity *entities)
 
KAPI void editor_add_to_selected_entities (struct editor_state *state, u32 count, kentity *entities)
 
KAPI void editor_select_parent (struct editor_state *state)
 
KAPI b8 editor_selection_contains (struct editor_state *state, kentity entity)
 
KAPI void editor_update (struct editor_state *state, frame_data *p_frame_data)
 
KAPI void editor_frame_prepare (struct editor_state *state, frame_data *p_frame_data, b8 draw_gizmo, keditor_gizmo_pass_render_data *gizmo_pass_render_data)
 
KAPI b8 editor_render (struct editor_state *state, frame_data *p_frame_data, ktexture colour_buffer_target, b8 draw_gizmo, keditor_gizmo_pass_render_data *gizmo_pass_render_data)
 
KAPI void editor_on_window_resize (struct editor_state *state, const struct kwindow *window)
 
KAPI void editor_setup_keymaps (struct editor_state *state)
 
KAPI void editor_destroy_keymaps (struct editor_state *state)
 
KAPI void editor_on_lib_load (struct editor_state *state)
 
KAPI void editor_on_lib_unload (struct editor_state *state)
 

Macro Definition Documentation

◆ EDITOR_AXIS_COLOUR_B

#define EDITOR_AXIS_COLOUR_B    (colour4){0.5f, 0.5f, 1.0f, 1.0f}

◆ EDITOR_AXIS_COLOUR_G

#define EDITOR_AXIS_COLOUR_G    (colour4){0.5f, 1.0f, 0.5f, 1.0f}

◆ EDITOR_AXIS_COLOUR_R

#define EDITOR_AXIS_COLOUR_R    (colour4){1.0f, 0.5f, 0.5f, 1.0f}

Typedef Documentation

◆ editor_mode

typedef enum editor_mode editor_mode

◆ editor_state

typedef struct editor_state editor_state

◆ keditor_gizmo_pass_data

◆ keditor_gizmo_pass_render_data

Enumeration Type Documentation

◆ editor_mode

Enumerator
EDITOR_MODE_SCENE 
EDITOR_MODE_ENTITY 
EDITOR_MODE_TREE 
EDITOR_MODE_ASSETS 

Function Documentation

◆ editor_add_to_selected_entities()

KAPI void editor_add_to_selected_entities ( struct editor_state state,
u32  count,
kentity entities 
)

◆ editor_clear_selected_entities()

KAPI void editor_clear_selected_entities ( struct editor_state state)

◆ editor_close()

KAPI b8 editor_close ( struct editor_state state)

◆ editor_destroy_keymaps()

KAPI void editor_destroy_keymaps ( struct editor_state state)

◆ editor_frame_prepare()

KAPI void editor_frame_prepare ( struct editor_state state,
frame_data p_frame_data,
b8  draw_gizmo,
keditor_gizmo_pass_render_data gizmo_pass_render_data 
)

◆ editor_initialize()

KAPI b8 editor_initialize ( u64 memory_requirement,
struct editor_state state 
)

◆ editor_on_lib_load()

KAPI void editor_on_lib_load ( struct editor_state state)

◆ editor_on_lib_unload()

KAPI void editor_on_lib_unload ( struct editor_state state)

◆ editor_on_window_resize()

KAPI void editor_on_window_resize ( struct editor_state state,
const struct kwindow window 
)

◆ editor_open()

KAPI b8 editor_open ( struct editor_state state,
kname  scene_name,
kname  scene_package_name 
)

◆ editor_render()

KAPI b8 editor_render ( struct editor_state state,
frame_data p_frame_data,
ktexture  colour_buffer_target,
b8  draw_gizmo,
keditor_gizmo_pass_render_data gizmo_pass_render_data 
)

◆ editor_select_entities()

KAPI void editor_select_entities ( struct editor_state state,
u32  count,
kentity entities 
)

◆ editor_select_parent()

KAPI void editor_select_parent ( struct editor_state state)

◆ editor_selection_contains()

KAPI b8 editor_selection_contains ( struct editor_state state,
kentity  entity 
)

◆ editor_set_mode()

KAPI void editor_set_mode ( struct editor_state state,
editor_mode  mode 
)

◆ editor_setup_keymaps()

KAPI void editor_setup_keymaps ( struct editor_state state)

◆ editor_shutdown()

KAPI void editor_shutdown ( struct editor_state state)

◆ editor_update()

KAPI void editor_update ( struct editor_state state,
frame_data p_frame_data 
)