Shader Tool
Small shader visualiser.
st::UIController Class Reference

Controls the application Front-end. More...

#include <UIController.hpp>

Public Member Functions

 UIController (shared_ptr< st::DocumentManager > dm, shared_ptr< st::ConfigurationManager > cm)
 Creates the controller and creates the UIBuilder. More...
 
void run ()
 Starts the drawing of nanogui and enters it's main loop. More...
 

Public Attributes

Canvascanvas
 
nanogui::TextBox * save_shader_name
 
nanogui::TextBox * open_shader_name
 
nanogui::TextBox * texture_path
 

Private Member Functions

void previewButton ()
 Preview button functionality. More...
 
void editButton ()
 Edit button functionality. More...
 
void saveButton ()
 Save button functionality. More...
 
void openButton ()
 Open shader functionality. More...
 
void openTexButton ()
 Open texture functionality. More...
 
void loadTexture (string path)
 Loads and sets the texture from the provided path. More...
 

Private Attributes

nanogui::Screen * screen
 
shared_ptr< st::DocumentManagerdoc_manager
 
shared_ptr< st::ConfigurationManagerconf_manager
 

Detailed Description

Controls the application Front-end.

Constructor & Destructor Documentation

◆ UIController()

st::UIController::UIController ( shared_ptr< st::DocumentManager dm,
shared_ptr< st::ConfigurationManager cm 
)

Creates the controller and creates the UIBuilder.

Parameters
dmDocumentManager used in the application.
cmCunfigurationManager

Member Function Documentation

◆ editButton()

void st::UIController::editButton ( )
private

Edit button functionality.

Opens the current file with the configured text editor.

◆ loadTexture()

void st::UIController::loadTexture ( string  path)
private

Loads and sets the texture from the provided path.

◆ openButton()

void st::UIController::openButton ( )
private

Open shader functionality.

Opens a new shader from the configured template.

◆ openTexButton()

void st::UIController::openTexButton ( )
private

Open texture functionality.

Loads a new texture from the configured path.

◆ previewButton()

void st::UIController::previewButton ( )
private

Preview button functionality.

Reads the shader from the file and sets it in the canvas.

◆ run()

void st::UIController::run ( )

Starts the drawing of nanogui and enters it's main loop.

◆ saveButton()

void st::UIController::saveButton ( )
private

Save button functionality.

Saves the current shader with another name. By not using this, if you are editing the default "newShader" will be overwritten the next time the program is ran.

Member Data Documentation

◆ canvas

Canvas* st::UIController::canvas

◆ conf_manager

shared_ptr< st::ConfigurationManager > st::UIController::conf_manager
private

◆ doc_manager

shared_ptr< st::DocumentManager > st::UIController::doc_manager
private

◆ open_shader_name

nanogui::TextBox* st::UIController::open_shader_name

◆ save_shader_name

nanogui::TextBox* st::UIController::save_shader_name

◆ screen

nanogui::Screen* st::UIController::screen
private

◆ texture_path

nanogui::TextBox* st::UIController::texture_path

The documentation for this class was generated from the following files: