Manages the shaders files.
More...
#include <DocumentManager.hpp>
Manages the shaders files.
◆ DocumentManager()
st::DocumentManager::DocumentManager |
( |
string |
path, |
|
|
string |
editor, |
|
|
vector< shared_ptr< Shader > > |
shaders |
|
) |
| |
|
inline |
Inits the DocumentManager and copies a template shader into the shadrers folder.
The template is copied to make sure the templates are never overwritten.
◆ createFromTemplate()
bool st::DocumentManager::createFromTemplate |
( |
string |
name | ) |
|
Creates a new shader file from the configured template.
◆ getShader()
shared_ptr<Shader> st::DocumentManager::getShader |
( |
| ) |
|
|
inline |
◆ loadShader() [1/2]
bool st::DocumentManager::loadShader |
( |
bool |
open = false | ) |
|
Reloads the current set shader.
- Parameters
-
open | Wether or not open the shader with the text editor. |
◆ loadShader() [2/2]
bool st::DocumentManager::loadShader |
( |
string |
path, |
|
|
bool |
open = false |
|
) |
| |
Loads a new shader.
If the shader file is not found, creates a new one in the provided path from the template.
- Parameters
-
open | Wether or not open the shader with the text editor. |
◆ openShader()
void st::DocumentManager::openShader |
( |
| ) |
|
Opens the current shader with the configured text editor.
◆ saveShader()
bool st::DocumentManager::saveShader |
( |
string |
name | ) |
|
Renames the current shader.
This prevents the shader from being overwritten if it is the "newShader".
- Parameters
-
name | Name of the new shader. Must not have extension. |
◆ default_shaders
vector< shared_ptr <Shader > > st::DocumentManager::default_shaders |
|
private |
◆ shader
Shader st::DocumentManager::shader |
|
private |
◆ shaders_path
const string st::DocumentManager::shaders_path |
◆ text_editor
string st::DocumentManager::text_editor |
|
private |
The documentation for this class was generated from the following files: