Lumenarium/src_v2/lumenarium_first.h

100 lines
2.4 KiB
C
Raw Normal View History

2022-03-22 18:13:06 +00:00
/* date = March 22nd 2022 2:29 am */
#ifndef LUMENARIUM_FIRST_H
#define LUMENARIUM_FIRST_H
typedef struct App_State App_State;
// Environment
2022-04-16 11:00:32 +00:00
#include "lumenarium_texture_atlas.c"
#include "lumenarium_geometry.h"
2022-04-12 06:01:17 +00:00
global Allocator* global_scratch_; // gets reset at frame boundaries
2022-04-16 11:00:32 +00:00
// TODO make sure all scratch_get's have a release
#define scratch_get(ident) Allocator_Scratch ident = allocator_scratch_begin(global_scratch_)
#define scratch_release(ident) allocator_scratch_end(&ident)
#include "lumenarium_bsp.h"
2022-03-22 18:13:06 +00:00
// Engine
typedef struct Assembly_Strip Assembly_Strip;
#include "engine/lumenarium_engine_output.h"
2022-03-22 18:13:06 +00:00
#include "engine/lumenarium_engine_assembly.h"
#include "engine/output/lumenarium_output_uart.h"
#include "engine/output/lumenarium_output_sacn.h"
2022-03-22 18:13:06 +00:00
// Editor
2022-04-16 11:00:32 +00:00
#include "editor/graphics/lumenarium_editor_opengl.h"
#include "editor/graphics/lumenarium_editor_graphics.h"
#include "editor/lumenarium_editor_ui.h"
#include "editor/lumenarium_editor_renderer.h"
2022-03-29 16:09:50 +00:00
#include "editor/lumenarium_editor.h"
2022-03-22 18:13:06 +00:00
//////////////////////////////////////////////
// Lumenarium Runtime Environment
global Allocator* permanent;
#if defined(DEBUG)
# include "lumenarium_tests.cpp"
2022-04-16 11:00:32 +00:00
#define lumenarium_env_validate() lumenarium_env_validate_()
2022-03-22 18:13:06 +00:00
#else
# define run_tests()
2022-04-16 11:00:32 +00:00
#define lumenarium_env_validate()
2022-03-22 18:13:06 +00:00
#endif
2022-04-16 11:00:32 +00:00
internal void
lumenarium_env_validate_()
{
bump_allocator_validate(permanent);
bump_allocator_validate(global_scratch_);
bump_allocator_validate(file_jobs_arena);
}
2022-03-22 18:13:06 +00:00
//////////////////////////////////////////////
// Lumenarium State
typedef b32 App_State_Flags;
enum
{
AppState_None = 0,
AppState_IsRunning = 1,
2022-03-29 16:09:50 +00:00
AppState_RunEditor = 2,
2022-04-16 11:00:32 +00:00
AppState_RunUserSpace = 4,
2022-03-22 18:13:06 +00:00
};
2022-04-16 11:00:32 +00:00
typedef struct App_Init_Desc App_Init_Desc;
struct App_Init_Desc
{
u32 assembly_cap;
};
2022-04-16 11:00:32 +00:00
typedef struct App_State App_State;
2022-03-22 18:13:06 +00:00
struct App_State
{
App_State_Flags flags;
2022-04-16 11:00:32 +00:00
File_Async_Job_System file_async_job_system;
2022-03-22 18:13:06 +00:00
Input_State* input_state;
Assembly_Array assemblies;
Output output;
2022-03-29 16:09:50 +00:00
Editor* editor;
2022-03-22 18:13:06 +00:00
};
2022-04-16 11:00:32 +00:00
#include "engine/lumenarium_engine_assembly.c"
#include "engine/lumenarium_engine.c"
#include "engine/lumenarium_engine_output.c"
#include "engine/output/lumenarium_output_uart.c"
#include "engine/output/lumenarium_output_sacn.c"
2022-04-16 11:00:32 +00:00
#include "editor/lumenarium_editor_ui.c"
#include "editor/lumenarium_editor_renderer.c"
#include "editor/lumenarium_editor_sculpture_visualizer.c"
#include "editor/lumenarium_editor.c"
2022-03-22 18:13:06 +00:00
#endif //LUMENARIUM_FIRST_H