UI - Refactoring progress

(see previous log message)
This commit is contained in:
Emmanuel BENOîT 2017-11-23 23:31:24 +01:00
parent 8fc496b15a
commit 05472b1c3a
35 changed files with 120 additions and 115 deletions

View file

@ -17,43 +17,43 @@ IMGUI = imgui.cpp imgui_draw.cpp
COMMON = \
common.cc \
c-filewatcher.cc \
c-utilities.cc \
\
c-ops.cc \
c-opast.cc \
c-opparser.cc \
c-opcomp.cc \
c-opmgr.cc \
\
utilities.cc \
texture.cc \
rendertarget.cc \
camera.cc \
\
profiling.cc \
shaders.cc \
odbg.cc \
undo.cc \
\
sync.cc \
syncedit.cc \
syncoverrides.cc \
\
ops.cc \
opast.cc \
opparser.cc \
opcomp.cc \
opmgr.cc \
\
ui.cc \
ui-actions.cc \
ui-app.cc \
ui-colorgrading.cc \
ui-dialogs.cc \
ui-imgui-sdl.cc \
ui-odbg.cc \
ui-overrides.cc \
ui-profiling.cc \
ui-rendertarget.cc \
ui-sequencer.cc \
ui-shaders.cc \
ui-sync.cc \
ui-texture.cc \
ui-utilities.cc \
ui-app.cc \
# END COMMON
DEMO = \
demo.cc \
main.cc \
opemu.cc \
ui-opemu.cc \
# END DEMO
PARSERCHECK = \

View file

@ -1,6 +1,5 @@
#include "externals.hh"
#include "c-filewatcher.hh"
#include "utilities.hh"
/*= T_FilesWatcher ===========================================================*/

View file

@ -1,5 +1,5 @@
#include "externals.hh"
#include "opast.hh"
#include "c-opast.hh"
#include "sync.hh"
#include <ebcl/Algorithms.hh>

View file

@ -1,7 +1,6 @@
#pragma once
#include "odbg.hh"
#include "c-renderdefs.hh"
#include <ebcl/SRDData.hh>
#include <ebcl/Sets.hh>
struct T_SyncOverrideSection;

View file

@ -1,6 +1,6 @@
#include "externals.hh"
#include "ops.hh"
#include "opcomp.hh"
#include "c-ops.hh"
#include "c-opcomp.hh"
#include <ebcl/Algorithms.hh>
#define INVASIVE_TRACES

View file

@ -1,6 +1,6 @@
#pragma once
#include "c-filewatcher.hh"
#include "opast.hh"
#include "c-opast.hh"
#include <ebcl/SRDData.hh>

View file

@ -1,7 +1,7 @@
#include "externals.hh"
#include "common.hh"
#include "opcomp.hh"
#include "ops.hh"
#include "c-opcomp.hh"
#include "c-ops.hh"
#include <ebcl/Files.hh>
#include <ebcl/SRDIO.hh>

View file

@ -1,7 +1,7 @@
#include "externals.hh"
#include "opast.hh"
#include "ops.hh"
#include "opcomp.hh"
#include "c-opast.hh"
#include "c-ops.hh"
#include "c-opcomp.hh"
#include "syncoverrides.hh"
#include <ebcl/Algorithms.hh>
#include <ebcl/SRDParser.hh>

View file

@ -1,5 +1,5 @@
#include "externals.hh"
#include "ops.hh"
#include "c-ops.hh"
using namespace ops;
using namespace ebcl;

View file

@ -1,6 +1,6 @@
#pragma once
#include "sync.hh"
#include "opast.hh"
#include "c-opast.hh"
struct T_Rendertarget;

35
c-renderdefs.hh Normal file
View file

@ -0,0 +1,35 @@
#pragma once
#ifndef REAL_BUILD
# include "externals.hh"
#endif
enum class E_TexType {
RGBA8 ,
RGBA16F ,
RGB8 ,
RGB16F ,
R8 ,
R16F ,
};
enum class E_TexSampling {
NEAREST ,
LINEAR ,
};
enum class E_TexWrap {
REPEAT ,
CLAMP_EDGE ,
CLAMP_BORDER
};
/*----------------------------------------------------------------------------*/
enum class E_ODbgMode {
LDR ,
LDR_ALPHA ,
HDR ,
DEPTH ,
__COUNT__
};

View file

@ -1,5 +1,5 @@
#include "externals.hh"
#include "utilities.hh"
#include "c-utilities.hh"
void updateAngle(

View file

@ -1,6 +1,6 @@
#include "externals.hh"
#include "camera.hh"
#include "utilities.hh"
#include "c-utilities.hh"
#include <glm/gtc/matrix_access.hpp>

View file

@ -2,9 +2,8 @@
#include "common.hh"
#include "c-filewatcher.hh"
#include "opcomp.hh"
#include "ops.hh"
#include "profiling.hh"
#include "c-opcomp.hh"
#include "c-ops.hh"
#include "sync.hh"
#include "undo.hh"
@ -14,7 +13,6 @@ namespace {
struct CommonData_
{
T_FilesWatcher watcher;
T_Profiler profiler;
T_SyncManager sync;
T_ScriptManager ops;
T_UndoManager undo;
@ -43,9 +41,6 @@ void Common::Shutdown( ) noexcept
T_FilesWatcher& Common::Watcher( ) noexcept
{ return M_GET_( watcher ); }
T_Profiler& Common::Profiler( ) noexcept
{ return M_GET_( profiler ); }
T_SyncManager& Common::Sync( ) noexcept
{ return M_GET_( sync ); }

View file

@ -5,7 +5,6 @@
struct T_FilesWatcher;
struct T_Profiler;
struct T_SyncManager;
struct T_ScriptManager;
class T_UndoManager;
@ -17,7 +16,6 @@ struct Common
static void Shutdown( ) noexcept;
static T_FilesWatcher& Watcher( ) noexcept;
static T_Profiler& Profiler( ) noexcept;
static T_SyncManager& Sync( ) noexcept;
static T_ScriptManager& Ops( ) noexcept;
static T_UndoManager& Undo( ) noexcept;

View file

@ -1,10 +1,10 @@
#include "externals.hh"
#include "demo.hh"
#include "sync.hh"
#include "rendertarget.hh"
#include "common.hh"
#include "opemu.hh"
#include "opcomp.hh"
#include "c-opcomp.hh"
#include "ui-opemu.hh"
#include "ui-rendertarget.hh"
#include <ebcl/Files.hh>
#include <ebcl/SRDText.hh>

View file

@ -1,6 +1,6 @@
#pragma once
#include "opcomp.hh"
#include "c-opcomp.hh"
namespace ops { class T_OpContext; }

22
main.cc
View file

@ -2,15 +2,15 @@
#include "ui-imgui-sdl.hh"
#include "demo.hh"
#include "common.hh"
#include "profiling.hh"
#include "shaders.hh"
#include "odbg.hh"
#include "opemu.hh"
#include "rendertarget.hh"
#include "sync.hh"
#include "ui.hh"
#include "ui-app.hh"
#include "ui-odbg.hh"
#include "ui-opemu.hh"
#include "ui-profiling.hh"
#include "ui-rendertarget.hh"
#include "ui-sequencer.hh"
#include "ui-shaders.hh"
#include "ui-sync.hh"
#include "ui-utilities.hh"
#include "undo.hh"
@ -58,7 +58,7 @@ T_Main::T_Main( )
void T_Main::mainLoop( )
{
auto& p( Common::Profiler( ) );
auto& p( UI::Profiler( ) );
while ( !done ) {
auto const& dspSize( ImGui::GetIO( ).DisplaySize );
if ( prevSize.x != dspSize.x || prevSize.y != dspSize.y ) {
@ -124,7 +124,7 @@ void T_Main::initDemo( )
printf( "init w/ dspsize %dx%d\n" , int( dspSize.x ) , int( dspSize.y ) );
if ( demo->initialise( (uint32_t) dspSize.x , (uint32_t) dspSize.y ) ) {
Common::Profiler( ).clear( );
UI::Profiler( ).clear( );
}
}
@ -233,7 +233,7 @@ void T_Main::makeUI( )
MenuItemCheckbox( "Output debugger" ,
&UI::ODbg( ).uiEnabled( ) );
MenuItemCheckbox( "Profiler" ,
&Common::Profiler( ).uiEnabled( ) );
&UI::Profiler( ).uiEnabled( ) );
MenuItemCheckbox( "Sequencer" , &eSequencer );
MenuItemCheckbox( "Shaders" ,
&UI::Shaders( ).uiEnabled( ) );
@ -248,7 +248,7 @@ void T_Main::makeUI( )
sequencer.clear( );
}
Common::Profiler( ).makeUI( );
UI::Profiler( ).makeUI( );
UI::ODbg( ).makeUI( );
UI::Shaders( ).makeUI( );
UI::Sync( ).makeOverridesWindow( );
@ -262,12 +262,12 @@ void T_Main::render( )
if ( demo ) {
demo->render( );
Common::Profiler( ).start( "Debug" );
UI::Profiler( ).start( "Debug" );
T_Rendertarget::MainOutput( );
if ( UI::ODbg( ).isActive( ) ) {
UI::ODbg( ).debugOutput( );
}
glFinish( ); Common::Profiler( ).end( "Debug" );
glFinish( ); UI::Profiler( ).end( "Debug" );
} else {
T_Rendertarget::MainOutput( );

View file

@ -1,7 +1,7 @@
#include "externals.hh"
#include "opast.hh"
#include "ops.hh"
#include "opcomp.hh"
#include "c-opast.hh"
#include "c-ops.hh"
#include "c-opcomp.hh"
#include <ebcl/Files.hh>
#include <ebcl/SRDText.hh>
#include <ebcl/Algorithms.hh>

View file

@ -1,6 +1,5 @@
#pragma once
#include "c-filewatcher.hh"
#include "utilities.hh"
#include <ebcl/SRDParserConfig.hh>
#include <ebcl/Sets.hh>

View file

@ -1,6 +1,6 @@
#include "externals.hh"
#include "odbg.hh"
#include "ui.hh"
#include "ui-odbg.hh"
namespace {

View file

@ -1,15 +1,6 @@
#pragma once
#include "texture.hh"
#include "shaders.hh"
enum class E_ODbgMode {
LDR ,
LDR_ALPHA ,
HDR ,
DEPTH ,
__COUNT__
};
#include "ui-texture.hh"
#include "ui-shaders.hh"
struct T_OutputDebugger

View file

@ -1,9 +1,10 @@
#include "externals.hh"
#include "opemu.hh"
#include "common.hh"
#include "ui.hh"
#include "profiling.hh"
#include "rendertarget.hh"
#include "ui-odbg.hh"
#include "ui-opemu.hh"
#include "ui-profiling.hh"
#include "ui-rendertarget.hh"
#include "sync.hh"
using namespace ops;
@ -64,7 +65,7 @@ struct T_RunGuard
~T_RunGuard( )
{
while ( !context.profiling.empty( ) ) {
Common::Profiler( ).end( context.profiling.last( ) );
UI::Profiler( ).end( context.profiling.last( ) );
context.profiling.removeLast( );
}
glUseProgram( 0 );
@ -681,14 +682,14 @@ void T_OpContext::run(
case OP_UI_PENTER:
{
T_String const& section( program.uiStrings[ instr.args[ 0 ] ] );
Common::Profiler( ).start( section );
UI::Profiler( ).start( section );
profiling.add( section );
break;
}
case OP_UI_PEXIT:
glFinish( );
Common::Profiler( ).end( profiling.last( ) );
UI::Profiler( ).end( profiling.last( ) );
profiling.removeLast( );
break;

View file

@ -1,5 +1,7 @@
#pragma once
#include "ops.hh"
#include "c-ops.hh"
#include "ui-shaders.hh"
#include "ui-texture.hh"
namespace ops {

View file

@ -1,5 +1,5 @@
#include "externals.hh"
#include "profiling.hh"
#include "ui-profiling.hh"
#include <sys/time.h>
#include <time.h>

View file

@ -1,5 +1,7 @@
#pragma once
#include "utilities.hh"
#ifndef REAL_BUILD
# include "externals.hh"
#endif
struct T_ProfilerSamples

View file

@ -1,5 +1,6 @@
#include "externals.hh"
#include "rendertarget.hh"
#include "ui-rendertarget.hh"
#include "ui-texture.hh"
T_RendertargetSetup::T_RendertargetSetup( )

View file

@ -4,9 +4,9 @@
#endif
#include <ebcl/Arrays.hh>
#include "texture.hh"
struct T_Texture;
struct T_Rendertarget;

View file

@ -1,7 +1,7 @@
#include "externals.hh"
#include "shaders.hh"
#include "common.hh"
#include "ui.hh"
#include "ui-shaders.hh"
#include "ui-utilities.hh"
#include <ebcl/Sets.hh>

View file

@ -1,6 +1,5 @@
#pragma once
#include "c-filewatcher.hh"
#include "utilities.hh"
/*= INPUT FILES ==============================================================*/

View file

@ -1,7 +1,7 @@
#include "externals.hh"
#include "texture.hh"
#include "ui.hh"
#include "odbg.hh"
#include "ui-odbg.hh"
#include "ui-texture.hh"
#include "ui-utilities.hh"

View file

@ -1,32 +1,9 @@
#pragma once
#ifndef REAL_BUILD
# include "externals.hh"
#endif
#include "c-renderdefs.hh"
struct T_OutputDebugger;
enum class E_TexType {
RGBA8 ,
RGBA16F ,
RGB8 ,
RGB16F ,
R8 ,
R16F ,
};
enum class E_TexSampling {
NEAREST ,
LINEAR ,
};
enum class E_TexWrap {
REPEAT ,
CLAMP_EDGE ,
CLAMP_BORDER
};
/*----------------------------------------------------------------------------*/
struct T_Texture

11
ui.cc
View file

@ -1,10 +1,11 @@
#include "externals.hh"
#include "odbg.hh"
#include "shaders.hh"
#include "texture.hh"
#include "ui.hh"
#include "ui-app.hh"
#include "ui-odbg.hh"
#include "ui-profiling.hh"
#include "ui-shaders.hh"
#include "ui-sync.hh"
#include "ui-texture.hh"
namespace {
@ -12,6 +13,7 @@ namespace {
struct UIData_
{
T_UIApp window;
T_Profiler profiler;
T_TextureManager textures;
T_ShaderManager shaders;
T_OutputDebugger odbg;
@ -41,6 +43,9 @@ void UI::Shutdown( ) noexcept
T_UIApp& UI::Main( ) noexcept
{ return M_GET_( window ); }
T_Profiler& UI::Profiler( ) noexcept
{ return M_GET_( profiler ); }
T_TextureManager& UI::Textures( ) noexcept
{ return M_GET_( textures ); }

8
ui.hh
View file

@ -3,10 +3,11 @@
# include "externals.hh"
#endif
struct T_UIApp;
struct T_TextureManager;
struct T_ShaderManager;
struct T_OutputDebugger;
struct T_Profiler;
struct T_ShaderManager;
struct T_TextureManager;
struct T_UIApp;
struct T_UISync;
@ -17,6 +18,7 @@ struct UI
static void Shutdown( ) noexcept;
static T_UIApp& Main( ) noexcept;
static T_Profiler& Profiler( ) noexcept;
static T_TextureManager& Textures( ) noexcept;
static T_ShaderManager& Shaders( ) noexcept;
static T_OutputDebugger& ODbg( ) noexcept;