Finality Engine
Loading...
Searching...
No Matches
GameViewSettings.h
Go to the documentation of this file.
1
6#pragma once
7#include <glm/glm.hpp>
8#include <algorithm>
9
10namespace FINALITY
11{
14 {
15 int Preset = 1;
16 bool Stats = false;
17 glm::vec2 Resolution(glm::vec2 available) const
18 {
19 if (Preset == 3) return {1280,720};
20 if (Preset == 4) return {1920,1080};
21 if (Preset == 5) return {2560,1440};
22 const float aspect = Preset == 1 ? 16.0f/9 : Preset == 2 ? 4.0f/3 : available.x/std::max(available.y,1.0f);
23 if (available.x/available.y > aspect) available.x = available.y*aspect;
24 else available.y = available.x/aspect;
25 return available;
26 }
27 };
28}
glm::vec2 Resolution(glm::vec2 available) const