demotool/demo.cc
2017-10-02 13:51:08 +02:00

58 lines
1.2 KiB
C++

#include "externals.hh"
#include "demo.hh"
T_Demo::T_Demo( __rw__ T_FilesWatcher& watcher ,
__rd__ const uint32_t width ,
__rd__ const uint32_t height )
: watcher( watcher ) , width( width ) , height( height )
{ }
bool T_Demo::initialise( )
{
raymarcher = std::make_unique< T_Raymarcher >(
watcher , width , height );
dof = std::make_unique< T_DoFPass >( watcher ,
raymarcher->output( ) , raymarcher->depth( ) );
bloom = std::make_unique< T_BloomPass >( watcher ,
raymarcher->output( ) );
combine = std::make_unique< T_CombinePass >( watcher ,
dof->output( ) , bloom->output( ) );
return true;
}
void T_Demo::makeUI( )
{
raymarcher->makeUI( );
dof->makeUI( );
bloom->makeUI( );
combine->makeUI( );
}
void T_Demo::render( )
{
raymarcher->render( );
dof->render( );
bloom->render( );
combine->render( );
}
void T_Demo::handleDND(
__rd__ ImVec2 const& move ,
__rd__ const bool hasCtrl ,
__rd__ const bool hasShift ,
__rd__ const bool lmb // Left mouse button
)
{
raymarcher->camera( ).handleDND( move , hasCtrl , hasShift , lmb );
}
void T_Demo::handleWheel(
__rd__ const float wheel ,
__rd__ const bool hasCtrl ,
__rd__ const bool hasShift
)
{
raymarcher->camera( ).handleWheel( wheel , hasCtrl , hasShift );
}