diff options
Diffstat (limited to 'core/os')
-rw-r--r-- | core/os/os.cpp | 9 | ||||
-rw-r--r-- | core/os/os.h | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/os/os.cpp b/core/os/os.cpp index c9a5cb1af8..f678d38f56 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -92,6 +92,14 @@ int OS::get_iterations_per_second() const { return ips; } +void OS::set_target_fps(int p_fps) { + _target_fps=p_fps>0? p_fps : 0; +} + +float OS::get_target_fps() const { + return _target_fps; +} + void OS::set_low_processor_usage_mode(bool p_enabled) { low_processor_usage_mode=p_enabled; @@ -474,6 +482,7 @@ OS::OS() { _exit_code=0; _orientation=SCREEN_LANDSCAPE; _fps=1; + _target_fps=0; _render_thread_mode=RENDER_THREAD_SAFE; Math::seed(1234567); } diff --git a/core/os/os.h b/core/os/os.h index c790b38635..b41bf6ce73 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -54,6 +54,7 @@ class OS { int _exit_code; int _orientation; float _fps; + int _target_fps; char *last_error; @@ -149,8 +150,12 @@ public: virtual void set_iterations_per_second(int p_ips); virtual int get_iterations_per_second() const; + virtual void set_target_fps(int p_fps); + virtual float get_target_fps() const; + virtual float get_frames_per_second() const { return _fps; }; + virtual void set_low_processor_usage_mode(bool p_enabled); virtual bool is_in_low_processor_usage_mode() const; |