demotool/ui-odbg.hh

78 lines
1.5 KiB
C++
Raw Normal View History

#pragma once
#include "ui-texture.hh"
#include "ui-shaders.hh"
struct T_OutputDebugger
{
friend struct T_Texture;
T_OutputDebugger( );
NO_COPY( T_OutputDebugger );
NO_MOVE( T_OutputDebugger );
~T_OutputDebugger( );
void registerTexture(
2017-11-04 09:29:06 +01:00
T_Texture& texture ,
const E_ODbgMode mode ,
T_String const& name );
bool& uiEnabled( )
{ return enabled_; }
void makeUI( );
bool isActive( ) const
{ return selected_ != -1; }
void debugOutput( );
private:
struct T_Texture_
{
GLuint id;
uint32_t levels;
E_ODbgMode mode;
2017-11-04 09:29:06 +01:00
T_String name;
//
int submode;
int lod;
};
using F_SubmodeSetup = std::function< void( GLuint ) >;
struct T_Submode_
{
2017-11-04 09:29:06 +01:00
T_String name;
T_ShaderPipeline pipeline;
F_SubmodeSetup setup;
};
bool enabled_ = false;
uint32_t nRegistered_ = 0;
2017-11-03 09:08:19 +01:00
T_Array< T_Texture_ > outputs_;
T_Array< T_Submode_ > submodes_[ int( E_ODbgMode::__COUNT__ ) ];
char* smCombo_[ int( E_ODbgMode::__COUNT__ ) ];
2017-11-04 09:29:06 +01:00
ebcl::T_StringBuilder imguiStrings;
int32_t selected_ = -1;
char* selectorItems_;
2017-11-03 09:08:19 +01:00
T_Array< int32_t > selectorMapping_;
void registerSubmode(
2017-11-04 09:29:06 +01:00
const E_ODbgMode mode ,
T_String const& name ,
2017-11-24 13:46:43 +01:00
char const* shader ,
2017-11-04 09:29:06 +01:00
F_SubmodeSetup setup = F_SubmodeSetup( ) );
void initSubmodeCombo( );
int32_t registerTexture(
2017-11-04 09:29:06 +01:00
const GLuint id ,
const uint32_t levels ,
const E_ODbgMode mode ,
T_String const& name );
void unregisterTexture(
2017-11-04 09:29:06 +01:00
const uint32_t index );
void makeSelectorItems( );
void clearSelectorItems( );
};