sculpto
application_config_window.cpp
Go to the documentation of this file.
1/*!****************************************************************//*!*
2 * \file application_config_window.cpp
3 * \brief Application configuration GUI window class implementation module.
4 *
5 * \author Sabitov Kirill
6 * \date 09 July 2022
7 *********************************************************************/
8
9#include "sclpch.h"
10
11#include <imgui.h>
12
18
20{
21 ImGui::Begin("Application Configuration");
22 {
23 ImGui::Text("GUI configuration");
24 ImGui::Checkbox("Use Dock space", &gui::IsDockspace);
25 ImGui::Separator();
26
27 vec4 clear_color = render_bridge::GetClearColor();
28 bool is_wireframe = render_bridge::GetWireframeMode();
29 bool is_vsync = render_bridge::GetVSync();
30 ImGui::Text("Renderer configuration");
31 if (ImGui::ColorEdit4("Clear Color", (float *)&clear_color))
33 if (ImGui::Checkbox("Wireframe Mode", &is_wireframe)) render_bridge::SetWireframeMode(is_wireframe);
34 if (ImGui::Checkbox("VSync", &is_vsync)) render_bridge::SetVSync(is_vsync);
35 ImGui::NewLine();
36
37 float w = ImGui::GetContentRegionAvail().x;
38 ImGui::Text("Renderer build-in resources");
39
40 if (ImGui::Button("Reload##shd1", { w * 0.2f, 0 })) assets_manager::UpdateShader(render_bridge::GetGaussianBlurPassShader()); ImGui::SameLine();
41 ImGui::Text("Shader \"%s\"", render_bridge::GetGaussianBlurPassShader()->DebugName.c_str());
42
43 if (ImGui::Button("Reload##shd2", { w * 0.2f, 0 })) assets_manager::UpdateShader(render_bridge::GetPhongGeometryShader()); ImGui::SameLine();
44 ImGui::Text("Shader \"%s\"", render_bridge::GetPhongGeometryShader()->DebugName.c_str());
45
46 if (ImGui::Button("Reload##shd3", { w * 0.2f, 0 })) assets_manager::UpdateShader(render_bridge::GetPhongLightingShader()); ImGui::SameLine();
47 ImGui::Text("Shader \"%s\"", render_bridge::GetPhongLightingShader()->DebugName.c_str());
48
49 if (ImGui::Button("Reload##shd4", { w * 0.2f, 0 })) assets_manager::UpdateShader(render_bridge::GetShadowPassShader()); ImGui::SameLine();
50 ImGui::Text("Shader \"%s\"", render_bridge::GetShadowPassShader()->DebugName.c_str());
51
52 if (ImGui::Button("Reload##shd5", { w * 0.2f, 0 })) assets_manager::UpdateShader(render_bridge::GetSingleColorMaterialShader()); ImGui::SameLine();
53 ImGui::Text("Shader \"%s\"", render_bridge::GetSingleColorMaterialShader()->DebugName.c_str());
54
55 if (ImGui::Button("Reload##shd6", { w * 0.2f, 0 })) assets_manager::UpdateShader(render_bridge::GetToneMappingPassShader()); ImGui::SameLine();
56 ImGui::Text("Shader \"%s\"", render_bridge::GetToneMappingPassShader()->DebugName.c_str());
57 }
58 ImGui::End();
59}
Application configuration GUI window class definition module.
static bool IsDockspace
Definition: gui.h:20
static shared< shader_program > GetGaussianBlurPassShader()
static void SetVSync(bool VSync)
Definition: render_bridge.h:44
static void SetClearColor(const vec4 &ClearColor)
Definition: render_bridge.h:38
static void SetWireframeMode(bool IsWireframe)
Definition: render_bridge.h:40
static shared< shader_program > GetPhongLightingShader()
static shared< shader_program > GetShadowPassShader()
static shared< shader_program > GetToneMappingPassShader()
static const vec4 & GetClearColor()
Definition: render_bridge.h:29
static shared< shader_program > GetPhongGeometryShader()
static shared< shader_program > GetSingleColorMaterialShader()
Definition: render_bridge.h:99
static bool GetVSync()
Definition: render_bridge.h:35
static bool GetWireframeMode()
Definition: render_bridge.h:31
void UpdateShader(shared< shader_program > ShaderProgram)
Render bridge class implementation module. Static class for making calls to low-level render api,...
Sculpto library prehompiled header. Defines common definitions, includes commonly used modules.
Shader program interface definition module.