Separated out the engine from the editor.
This commit is contained in:
parent
50c2ef9290
commit
62e22979f3
|
@ -25,7 +25,7 @@ set LastError=%ERRORLEVEL%
|
||||||
|
|
||||||
del lock.tmp
|
del lock.tmp
|
||||||
|
|
||||||
cl %CommonCompilerFlags% %SourceCodePath%\win32_foldhaus.cpp /link %CommonLinkerFlags% user32.lib winmm.lib gdi32.lib opengl32.lib dsound.lib Ws2_32.lib Comdlg32.lib
|
cl %CommonCompilerFlags% %SourceCodePath%\platform_win32\win32_foldhaus.cpp /link %CommonLinkerFlags% user32.lib winmm.lib gdi32.lib opengl32.lib dsound.lib Ws2_32.lib Comdlg32.lib
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#include <objc/message.h>
|
|
||||||
#include <objc/runtime.h>
|
|
||||||
|
|
||||||
typedef struct AppDel {
|
|
||||||
Class isa;
|
|
||||||
id window;
|
|
||||||
} AppDelegate;
|
|
||||||
|
|
||||||
BOOL AppDel_didFinishLaunching(AppDelegate* self, SEL _command, id Notification)
|
|
||||||
{
|
|
||||||
return YES;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main(int ArgCount, char** Args)
|
|
||||||
{
|
|
||||||
Class NSApplicationClass = (Class)objc_getClass("NSApplication");
|
|
||||||
Class AppDelegateClass = objc_allocateClassPair(NSApplicationClass, "AppDelegate", 0);
|
|
||||||
|
|
||||||
SEL MethodSelector = sel_getUid("applicationDidFinishLaunching:");
|
|
||||||
// NOTE(Peter): i = int, @ = object, : = method selector (SEL)
|
|
||||||
char MethodSignature[] = "i@:@";
|
|
||||||
class_addMethod(AppDelegateClass, MethodSelector, (IMP)AppDel_didFinishLaunching, "i@:@");
|
|
||||||
objc_registerClassPair(AppDelegateClass);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
|
@ -141,7 +141,6 @@ INITIALIZE_APPLICATION(InitializeApplication)
|
||||||
State->Interface.Style.RowHeight = ui_GetTextLineHeight(State->Interface);
|
State->Interface.Style.RowHeight = ui_GetTextLineHeight(State->Interface);
|
||||||
|
|
||||||
State->SACN = InitializeSACN(Context);
|
State->SACN = InitializeSACN(Context);
|
||||||
State->NetworkProtocolHeaderSize = STREAM_HEADER_SIZE;
|
|
||||||
|
|
||||||
State->Camera.FieldOfView = 45.0f;
|
State->Camera.FieldOfView = 45.0f;
|
||||||
State->Camera.AspectRatio = RectAspectRatio(State->WindowBounds);
|
State->Camera.AspectRatio = RectAspectRatio(State->WindowBounds);
|
||||||
|
@ -294,9 +293,6 @@ CreateDMXBuffers(assembly Assembly, led_system* LedSystem, s32 BufferHeaderSize,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define HANDMADE_MATH_IMPLEMENTATION
|
|
||||||
#include "handmade_math.h"
|
|
||||||
|
|
||||||
UPDATE_AND_RENDER(UpdateAndRender)
|
UPDATE_AND_RENDER(UpdateAndRender)
|
||||||
{
|
{
|
||||||
DEBUG_TRACK_FUNCTION;
|
DEBUG_TRACK_FUNCTION;
|
||||||
|
@ -440,12 +436,11 @@ UPDATE_AND_RENDER(UpdateAndRender)
|
||||||
|
|
||||||
// Skipped for performance at the moment
|
// Skipped for performance at the moment
|
||||||
#if 0
|
#if 0
|
||||||
s32 HeaderSize = State->NetworkProtocolHeaderSize;
|
|
||||||
dmx_buffer_list* DMXBuffers = 0;
|
dmx_buffer_list* DMXBuffers = 0;
|
||||||
for (u32 i = 0; i < State->Assemblies.Count; i++)
|
for (u32 i = 0; i < State->Assemblies.Count; i++)
|
||||||
{
|
{
|
||||||
assembly* Assembly = &State->Assemblies.Values[i];
|
assembly* Assembly = &State->Assemblies.Values[i];
|
||||||
dmx_buffer_list* NewDMXBuffers = CreateDMXBuffers(*Assembly, &State->LedSystem, HeaderSize, &State->Transient);
|
dmx_buffer_list* NewDMXBuffers = CreateDMXBuffers(*Assembly, &State->LedSystem, STREAM_HEADER_SIZE, &State->Transient);
|
||||||
DMXBuffers = DMXBufferListAppend(DMXBuffers, NewDMXBuffers);
|
DMXBuffers = DMXBufferListAppend(DMXBuffers, NewDMXBuffers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,24 +13,24 @@
|
||||||
|
|
||||||
#include "interface.h"
|
#include "interface.h"
|
||||||
|
|
||||||
#include "foldhaus_network_ordering.h"
|
#include "engine/foldhaus_network_ordering.h"
|
||||||
#include "dmx/dmx.h"
|
#include "engine/dmx/dmx.h"
|
||||||
#include "sacn/sacn.h"
|
#include "engine/sacn/sacn.h"
|
||||||
|
|
||||||
#include "foldhaus_assembly.h"
|
#include "engine/foldhaus_assembly.h"
|
||||||
#include "assembly_parser.cpp"
|
#include "engine/assembly_parser.cpp"
|
||||||
|
|
||||||
typedef struct app_state app_state;
|
typedef struct app_state app_state;
|
||||||
|
|
||||||
// TODO(Peter): something we can do later is to remove all reliance on app_state and context
|
// TODO(Peter): something we can do later is to remove all reliance on app_state and context
|
||||||
// from foldhaus_pane.h. It should just emit lists of things that the app can iterate over and
|
// from foldhaus_pane.h. It should just emit lists of things that the app can iterate over and
|
||||||
// perform operations on, like panel_draw_requests = { bounds, panel* } etc.
|
// perform operations on, like panel_draw_requests = { bounds, panel* } etc.
|
||||||
#include "foldhaus_panel.h"
|
#include "editor/foldhaus_panel.h"
|
||||||
|
|
||||||
#include "foldhaus_command_dispatch.h"
|
#include "editor/foldhaus_command_dispatch.h"
|
||||||
#include "foldhaus_operation_mode.h"
|
#include "editor/foldhaus_operation_mode.h"
|
||||||
|
|
||||||
#include "animation/foldhaus_animation.h"
|
#include "engine/animation/foldhaus_animation.h"
|
||||||
|
|
||||||
enum network_protocol
|
enum network_protocol
|
||||||
{
|
{
|
||||||
|
@ -42,38 +42,33 @@ enum network_protocol
|
||||||
|
|
||||||
struct app_state
|
struct app_state
|
||||||
{
|
{
|
||||||
r32 CameraTheta; // TODO(Peter): @TEMPORARY
|
|
||||||
rect2 WindowBounds;
|
|
||||||
|
|
||||||
gs_memory_arena Permanent;
|
gs_memory_arena Permanent;
|
||||||
gs_memory_arena Transient;
|
gs_memory_arena Transient;
|
||||||
|
|
||||||
s32 NetworkProtocolHeaderSize;
|
// Engine
|
||||||
|
//
|
||||||
network_protocol NetworkProtocol;
|
network_protocol NetworkProtocol;
|
||||||
|
|
||||||
streaming_acn SACN;
|
streaming_acn SACN;
|
||||||
|
|
||||||
led_system LedSystem;
|
led_system LedSystem;
|
||||||
assembly_array Assemblies;
|
assembly_array Assemblies;
|
||||||
|
animation_system AnimationSystem;
|
||||||
|
event_log* GlobalLog;
|
||||||
|
|
||||||
camera Camera;
|
// Interface
|
||||||
r32 PixelsToWorldScale;
|
//
|
||||||
|
rect2 WindowBounds;
|
||||||
|
|
||||||
operation_mode_system Modes;
|
operation_mode_system Modes;
|
||||||
input_command_queue CommandQueue;
|
input_command_queue CommandQueue;
|
||||||
|
|
||||||
ui_interface Interface;
|
ui_interface Interface;
|
||||||
|
|
||||||
animation_system AnimationSystem;
|
|
||||||
gs_list_handle SelectedAnimationBlockHandle;
|
|
||||||
u32 SelectedAnimationLayer;
|
|
||||||
|
|
||||||
panel_system PanelSystem;
|
panel_system PanelSystem;
|
||||||
panel* HotPanel;
|
panel* HotPanel;
|
||||||
|
|
||||||
//pattern_node_workspace NodeWorkspace;
|
camera Camera; // TODO(Peter): move into the sculpture view
|
||||||
|
r32 PixelsToWorldScale;
|
||||||
event_log* GlobalLog;
|
gs_list_handle SelectedAnimationBlockHandle; // TODO(Peter): move into animation panel
|
||||||
|
u32 SelectedAnimationLayer; // TODO(Peter): move into animation panel
|
||||||
};
|
};
|
||||||
|
|
||||||
internal void OpenColorPicker(app_state* State, v4* Address);
|
internal void OpenColorPicker(app_state* State, v4* Address);
|
||||||
|
@ -180,7 +175,7 @@ TestPatternThree(led_buffer* Assembly, r32 Time)
|
||||||
|
|
||||||
// END TEMPORARY PATTERNS
|
// END TEMPORARY PATTERNS
|
||||||
|
|
||||||
#include "foldhaus_assembly.cpp"
|
#include "engine/foldhaus_assembly.cpp"
|
||||||
|
|
||||||
FOLDHAUS_INPUT_COMMAND_PROC(EndCurrentOperationMode)
|
FOLDHAUS_INPUT_COMMAND_PROC(EndCurrentOperationMode)
|
||||||
{
|
{
|
||||||
|
@ -208,16 +203,16 @@ struct panel_definition
|
||||||
s32 InputCommandsCount;
|
s32 InputCommandsCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "panels/foldhaus_panel_sculpture_view.h"
|
#include "editor/panels/foldhaus_panel_sculpture_view.h"
|
||||||
#include "panels/foldhaus_panel_profiler.h"
|
#include "editor/panels/foldhaus_panel_profiler.h"
|
||||||
#include "panels/foldhaus_panel_dmx_view.h"
|
#include "editor/panels/foldhaus_panel_dmx_view.h"
|
||||||
#include "panels/foldhaus_panel_animation_timeline.h"
|
#include "editor/panels/foldhaus_panel_animation_timeline.h"
|
||||||
#include "panels/foldhaus_panel_hierarchy.h"
|
#include "editor/panels/foldhaus_panel_hierarchy.h"
|
||||||
#include "panels/foldhaus_panel_file_view.h"
|
#include "editor/panels/foldhaus_panel_file_view.h"
|
||||||
|
|
||||||
#include "generated/foldhaus_panels_generated.h"
|
#include "generated/foldhaus_panels_generated.h"
|
||||||
|
|
||||||
#include "foldhaus_interface.cpp"
|
#include "editor/foldhaus_interface.cpp"
|
||||||
|
|
||||||
#include "../meta/gs_meta_include.cpp"
|
#include "../meta/gs_meta_include.cpp"
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,9 @@
|
||||||
// Author: Peter Slattery
|
// Author: Peter Slattery
|
||||||
// Creation Date: 2020-01-01
|
// Creation Date: 2020-01-01
|
||||||
//
|
//
|
||||||
|
// DESCRIPTION:
|
||||||
|
// This file contains profiling capabilities for both the engine and app
|
||||||
|
//
|
||||||
#ifndef FOLDHAUS_DEBUG_H
|
#ifndef FOLDHAUS_DEBUG_H
|
||||||
|
|
||||||
#define SCOPE_NAME_LENGTH 256
|
#define SCOPE_NAME_LENGTH 256
|
||||||
|
|
|
@ -11,15 +11,15 @@
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
#include <gl/gl.h>
|
#include <gl/gl.h>
|
||||||
|
|
||||||
#include "../meta/gs_meta_include.h"
|
#include "../../meta/gs_meta_include.h"
|
||||||
#include "foldhaus_platform.h"
|
#include "../foldhaus_platform.h"
|
||||||
|
|
||||||
#include "../gs_libs/gs_win32.cpp"
|
#include "../../gs_libs/gs_win32.cpp"
|
||||||
#include "win32_foldhaus_memory.h"
|
#include "win32_foldhaus_memory.h"
|
||||||
#include "win32_foldhaus_dll.h"
|
#include "win32_foldhaus_dll.h"
|
||||||
#include "win32_foldhaus_timing.h"
|
#include "win32_foldhaus_timing.h"
|
||||||
|
|
||||||
#include "foldhaus_renderer.cpp"
|
#include "../foldhaus_renderer.cpp"
|
||||||
|
|
||||||
global b32 Running = false;
|
global b32 Running = false;
|
||||||
global b32 WindowIsActive = false;
|
global b32 WindowIsActive = false;
|
Loading…
Reference in New Issue