Falco Engine 3.9.0.1 (beta)
QualitySettings.cs
Go to the documentation of this file.
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Runtime.CompilerServices;
5using System.Text;
6
7namespace FalcoEngine
8{
9 public static class QualitySettings
10 {
11 //Enums
12
17 {
18 Level1,
19 Level2,
20 Level3,
21 Level4,
22 Level5,
23 Level6
24 }
25
30 {
31 Two,
32 Three,
33 Four
34 }
35
40 {
41 Off,
42 Low,
43 Normal,
44 High
45 }
46
47 //Screen
48
54 [MethodImpl(MethodImplOptions.InternalCall)]
55 public static extern void SetWindowSize(int width, int height);
56
61 [MethodImpl(MethodImplOptions.InternalCall)]
62 public static extern int GetWindowWidth();
63
68 [MethodImpl(MethodImplOptions.InternalCall)]
69 public static extern int GetWindowHeight();
70
75 [MethodImpl(MethodImplOptions.InternalCall)]
76 public static extern void SetFullScreen(bool value);
77
82 [MethodImpl(MethodImplOptions.InternalCall)]
83 public static extern bool GetFullScreen();
84
89 [MethodImpl(MethodImplOptions.InternalCall)]
90 public static extern void SetExclusiveMode(bool value);
91
96 [MethodImpl(MethodImplOptions.InternalCall)]
97 public static extern bool GetExclusiveMode();
98
99 //V-Sync
100
105 [MethodImpl(MethodImplOptions.InternalCall)]
106 public static extern void SetVSync(bool value);
107
112 [MethodImpl(MethodImplOptions.InternalCall)]
113 public static extern bool GetVSync();
114
115 //FXAA
116
121 [MethodImpl(MethodImplOptions.InternalCall)]
122 public static extern void SetFXAA(bool value);
123
128 [MethodImpl(MethodImplOptions.InternalCall)]
129 public static extern bool GetFXAA();
130
131 //Dynamic resolution
132
137 [MethodImpl(MethodImplOptions.InternalCall)]
138 public static extern void SetDynamicResolution(bool value);
139
144 [MethodImpl(MethodImplOptions.InternalCall)]
145 public static extern bool GetDynamicResolution();
146
151 [MethodImpl(MethodImplOptions.InternalCall)]
152 public static extern void SetDynamicResolutionValue(float value);
153
158 [MethodImpl(MethodImplOptions.InternalCall)]
159 public static extern float GetDynamicResolutionValue();
160
165 [MethodImpl(MethodImplOptions.InternalCall)]
166 public static extern void SetAutoDynamicResolution(bool value);
167
172 [MethodImpl(MethodImplOptions.InternalCall)]
173 public static extern bool GetAutoDynamicResolution();
174
179 [MethodImpl(MethodImplOptions.InternalCall)]
180 public static extern void SetAutoDynamicResolutionTargetFPS(int value);
181
186 [MethodImpl(MethodImplOptions.InternalCall)]
187 public static extern int GetAutoDynamicResolutionTargetFPS();
188
189 //Shadows
190
195 public static void SetDirectionalShadowsQuality(ShadowsQualityLevel qualityLevel)
196 {
197 INTERNAL_SetDirectionalShadowsQuality((int)qualityLevel);
198 }
199
205 {
206 return (ShadowsQualityLevel)INTERNAL_GetDirectionalShadowsQuality();
207 }
208
209 [MethodImpl(MethodImplOptions.InternalCall)]
210 static extern void INTERNAL_SetDirectionalShadowsQuality(int qualityLevel);
211
212 [MethodImpl(MethodImplOptions.InternalCall)]
213 static extern int INTERNAL_GetDirectionalShadowsQuality();
214
215 //
216
221 public static void SetPointShadowsQuality(ShadowsQualityLevel qualityLevel)
222 {
223 INTERNAL_SetPointShadowsQuality((int)qualityLevel);
224 }
225
231 {
232 return (ShadowsQualityLevel)INTERNAL_GetPointShadowsQuality();
233 }
234
235 [MethodImpl(MethodImplOptions.InternalCall)]
236 static extern void INTERNAL_SetPointShadowsQuality(int qualityLevel);
237
238 [MethodImpl(MethodImplOptions.InternalCall)]
239 static extern int INTERNAL_GetPointShadowsQuality();
240
241 //
242
247 public static void SetSpotShadowsQuality(ShadowsQualityLevel qualityLevel)
248 {
249 INTERNAL_SetSpotShadowsQuality((int)qualityLevel);
250 }
251
257 {
258 return (ShadowsQualityLevel)INTERNAL_GetSpotShadowsQuality();
259 }
260
261 [MethodImpl(MethodImplOptions.InternalCall)]
262 static extern void INTERNAL_SetSpotShadowsQuality(int qualityLevel);
263
264 [MethodImpl(MethodImplOptions.InternalCall)]
265 static extern int INTERNAL_GetSpotShadowsQuality();
266
267 //
268
273 public static void SetShadowsCascadesCount(ShadowsCascadesCount cascadesCount)
274 {
275 INTERNAL_SetShadowsCascadesCount((int)cascadesCount);
276 }
277
283 {
284 return (ShadowsCascadesCount)INTERNAL_GetShadowsCascadesCount();
285 }
286
287 [MethodImpl(MethodImplOptions.InternalCall)]
288 static extern void INTERNAL_SetShadowsCascadesCount(int cascadesCount);
289
290 [MethodImpl(MethodImplOptions.InternalCall)]
291 static extern int INTERNAL_GetShadowsCascadesCount();
292
293 //
294
299 public static void SetShadowsSofteness(ShadowsSoftenessLevel shadowsSofteness)
300 {
301 INTERNAL_SetShadowsSofteness((int)shadowsSofteness);
302 }
303
309 {
310 return (ShadowsSoftenessLevel)INTERNAL_GetShadowsSofteness();
311 }
312
313 [MethodImpl(MethodImplOptions.InternalCall)]
314 static extern void INTERNAL_SetShadowsSofteness(int shadowsSofteness);
315
316 [MethodImpl(MethodImplOptions.InternalCall)]
317 static extern int INTERNAL_GetShadowsSofteness();
318
319 //
320
325 [MethodImpl(MethodImplOptions.InternalCall)]
326 public static extern void SetShadowsDistance(float value);
327
332 [MethodImpl(MethodImplOptions.InternalCall)]
333 public static extern float GetShadowsDistance();
334
339 [MethodImpl(MethodImplOptions.InternalCall)]
340 public static extern void SetShadowsEnabled(bool value);
341
346 [MethodImpl(MethodImplOptions.InternalCall)]
347 public static extern bool GetShadowsEnabled();
348 }
349}
static void SetExclusiveMode(bool value)
Set window should run in exclusive mode and switch display resolution if needed
static ShadowsSoftenessLevel GetShadowsSofteness()
Return shadows softeness
static void SetFullScreen(bool value)
Set window fullscreen
static bool GetFullScreen()
Return true if window is in fullscreen
ShadowsSoftenessLevel
Shadows softeness level enum
static float GetShadowsDistance()
Return shadows distance
static void SetAutoDynamicResolution(bool value)
Set use auto back buffer dynamic resolution
static void SetDirectionalShadowsQuality(ShadowsQualityLevel qualityLevel)
Set directional shadows quality
static float GetDynamicResolutionValue()
Return back buffer resolution ratio
static void SetVSync(bool value)
Set V-Sync enabled or not
static bool GetAutoDynamicResolution()
Returns if auto back buffer dynamic resolution is using
static bool GetVSync()
Return true if V-Sync is enabled
ShadowsQualityLevel
Shadows quality level enum
static void SetShadowsDistance(float value)
Set distance in which shadows will be visible
static void SetShadowsEnabled(bool value)
Enable/disable shadows
ShadowsCascadesCount
Shadows cascades count enum
static void SetDynamicResolutionValue(float value)
Set back buffer resolution ratio (from 0.5 to 1)
static bool GetDynamicResolution()
Returns if back buffer dynamic resolution is using
static int GetWindowHeight()
Return window height
static void SetShadowsSofteness(ShadowsSoftenessLevel shadowsSofteness)
Set shadows softeness
static void SetShadowsCascadesCount(ShadowsCascadesCount cascadesCount)
Set shadows cascades count (for directional lights only)
static void SetDynamicResolution(bool value)
Set use back buffer dynamic resolution
static bool GetShadowsEnabled()
Returns if shadows are enabled
static ShadowsQualityLevel GetSpotShadowsQuality()
Return spot shadows quality
static int GetWindowWidth()
Return window width
static void SetPointShadowsQuality(ShadowsQualityLevel qualityLevel)
Set point shadows quality
static ShadowsQualityLevel GetPointShadowsQuality()
Return point shadows quality
static bool GetFXAA()
Return true if FXAA anti aliasing is enabled
static ShadowsQualityLevel GetDirectionalShadowsQuality()
Return directional shadows quality
static void SetAutoDynamicResolutionTargetFPS(int value)
Set target frames per second for auto dynamic resolution
static void SetSpotShadowsQuality(ShadowsQualityLevel qualityLevel)
Set spot shadows quality
static bool GetExclusiveMode()
Return true if window is running in exclusive mode
static void SetFXAA(bool value)
Set use FXAA anti aliasing
static int GetAutoDynamicResolutionTargetFPS()
Return target frames per second for auto dynamic resolution
static ShadowsCascadesCount GetShadowsCascadesCount()
Return shadows cascades count
static void SetWindowSize(int width, int height)
Set window size