Finality Engine
Toggle main menu visibility
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
10
namespace
FINALITY
11
{
13
struct
GameViewSettings
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
}
FINALITY
Definition
Asset.h:12
FINALITY::GameViewSettings
Definition
GameViewSettings.h:14
FINALITY::GameViewSettings::Stats
bool Stats
Definition
GameViewSettings.h:16
FINALITY::GameViewSettings::Resolution
glm::vec2 Resolution(glm::vec2 available) const
Definition
GameViewSettings.h:17
FINALITY::GameViewSettings::Preset
int Preset
Definition
GameViewSettings.h:15
FinalityEditor
src
Editor
GameViewSettings.h
Generated by
1.18.0