VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
WorldSettingsMenu.hpp
1
6
7#pragma once
8
9#include <imgui.h>
10#include "Engine.hpp"
11#include "components/Environment.hpp"
12
13namespace vex {
18 inline void DrawWorldSettings(Engine& engine) {
19 auto env = engine.getEnvironmentSettings();
20 bool changed = false;
21
22 if (ImGui::CollapsingHeader("Shading & Retro Effects", ImGuiTreeNodeFlags_DefaultOpen)) {
23 changed |= ImGui::Checkbox("Gouraud Shading", &env.gourardShading);
24 changed |= ImGui::Checkbox("Vertex Jitter (Passive)", &env.passiveVertexJitter);
25 changed |= ImGui::Checkbox("Vertex Snapping (Active)", &env.vertexSnapping);
26 changed |= ImGui::Checkbox("Affine Texture Warping", &env.affineWarping);
27 changed |= ImGui::Checkbox("Screen Color Quantization", &env.screenQuantization);
28 changed |= ImGui::Checkbox("Texture Color Quantization", &env.textureQuantization);
29 changed |= ImGui::Checkbox("Screen Dithering", &env.screenDither);
30 changed |= ImGui::Checkbox("CRT Artifacts", &env.ntfsArtifacts);
31 }
32
33 if (ImGui::CollapsingHeader("Lighting & Atmosphere", ImGuiTreeNodeFlags_DefaultOpen)) {
34 changed |= ImGui::ColorEdit3("Clear Color", &env.clearColor.x);
35 ImGui::Spacing();
36
37 changed |= ImGui::ColorEdit3("Ambient Color", &env.ambientLight.x);
38 changed |= ImGui::DragFloat("Ambient Intensity", &env.ambientLightStrength, 0.01f, 0.0f, 5.0f);
39
40 ImGui::Spacing();
41 changed |= ImGui::ColorEdit3("Sun Color", &env.sunLight.x);
42 changed |= ImGui::DragFloat3("Sun Direction", &env.sunDirection.x, 0.01f, -1.0f, 1.0f);
43 }
44
45 if (changed) {
46 engine.setEnvironmentSettings(env);
47 }
48 }
49}
Contains main Engine class.
Class for interaction with engine systems.
Definition Engine.hpp:47
environment getEnvironmentSettings()
Returns the current environment settings.
Definition Engine.cpp:249
void setEnvironmentSettings(environment settings)
Applies new global environment settings (lighting, shading) to the interface.
Definition Engine.cpp:245
void DrawWorldSettings(Engine &engine)
Draws the world settings menu, allowing modification of environment parameters like shading,...