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;
|
|
|
|
|
2022-03-27 10:47:18 +00:00
|
|
|
// Environment
|
2022-04-16 11:00:32 +00:00
|
|
|
#include "lumenarium_texture_atlas.c"
|
2022-04-12 05:53:32 +00:00
|
|
|
#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)
|
2022-04-12 05:53:32 +00:00
|
|
|
#include "lumenarium_bsp.h"
|
2022-03-22 18:13:06 +00:00
|
|
|
|
2022-05-13 11:45:40 +00:00
|
|
|
#include "patterns/patterns_math.h"
|
|
|
|
|
2022-03-27 10:47:18 +00:00
|
|
|
// Engine
|
2022-04-06 18:29:32 +00:00
|
|
|
typedef struct Assembly_Strip Assembly_Strip;
|
2022-04-22 18:57:52 +00:00
|
|
|
typedef struct Assembly_Pixel_Buffer Assembly_Pixel_Buffer;
|
2022-04-06 18:29:32 +00:00
|
|
|
#include "engine/lumenarium_engine_output.h"
|
2022-03-22 18:13:06 +00:00
|
|
|
#include "engine/lumenarium_engine_assembly.h"
|
2022-04-06 18:29:32 +00:00
|
|
|
#include "engine/output/lumenarium_output_uart.h"
|
|
|
|
#include "engine/output/lumenarium_output_sacn.h"
|
2022-03-22 18:13:06 +00:00
|
|
|
|
2022-03-27 10:47:18 +00:00
|
|
|
// Editor
|
2022-05-25 12:30:20 +00:00
|
|
|
#if defined(PLATFORM_SUPPORTS_EDITOR)
|
|
|
|
# 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"
|
|
|
|
# include "editor/lumenarium_editor.h"
|
|
|
|
#endif // PLATFORM_SUPPORTS_EDITOR
|
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-04-22 18:57:52 +00:00
|
|
|
|
|
|
|
core_socket_tests();
|
2022-04-16 11:00:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
2022-03-27 10:47:18 +00:00
|
|
|
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
|
|
|
|
{
|
2022-08-08 09:39:42 +00:00
|
|
|
r64 target_seconds_per_frame;
|
2022-03-22 18:13:06 +00:00
|
|
|
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
|
|
|
|
2022-04-06 18:29:32 +00:00
|
|
|
Input_State* input_state;
|
|
|
|
|
2022-03-27 10:47:18 +00:00
|
|
|
Assembly_Array assemblies;
|
2022-04-06 18:29:32 +00:00
|
|
|
Output output;
|
2022-03-29 16:09:50 +00:00
|
|
|
|
2022-05-25 12:30:20 +00:00
|
|
|
#if defined(PLATFORM_SUPPORTS_EDITOR)
|
|
|
|
Editor* editor;
|
|
|
|
#endif
|
2022-08-08 09:39:42 +00:00
|
|
|
|
|
|
|
u8* user_space_data;
|
2022-03-22 18:13:06 +00:00
|
|
|
};
|
|
|
|
|
2022-05-25 12:30:20 +00:00
|
|
|
typedef struct Editor_Desc Editor_Desc;
|
|
|
|
struct Editor_Desc
|
|
|
|
{
|
|
|
|
v2 content_scale;
|
|
|
|
v2 init_window_dim;
|
|
|
|
};
|
|
|
|
|
2022-07-04 16:00:58 +00:00
|
|
|
void sculpture_updated(App_State* state, r32 scale, r32 led_size);
|
|
|
|
|
2022-08-08 09:39:42 +00:00
|
|
|
#include "user_space/incenter_user_space.h"
|
|
|
|
//#include "../run_tree/data/incenter_test_data.c"
|
2022-03-27 10:47:18 +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-03-27 10:47:18 +00:00
|
|
|
|
2022-08-08 09:39:42 +00:00
|
|
|
internal void incenter_sculpture_visualizer_ui(App_State* state, Editor* ed);
|
|
|
|
|
2022-05-25 12:30:20 +00:00
|
|
|
#if defined(PLATFORM_SUPPORTS_EDITOR)
|
|
|
|
# include "editor/lumenarium_editor_ui.c"
|
|
|
|
# include "editor/lumenarium_editor_renderer.c"
|
|
|
|
# include "editor/lumenarium_editor_sculpture_visualizer.c"
|
|
|
|
# include "editor/lumenarium_editor.c"
|
|
|
|
#endif
|
2022-03-27 10:47:18 +00:00
|
|
|
|
2022-03-22 18:13:06 +00:00
|
|
|
#endif //LUMENARIUM_FIRST_H
|