Merge pull request #35092 from AndreaCatania/frames_exp

Exposed physics frame count and idle frame count
This commit is contained in:
Rémi Verschelde 2020-01-14 08:25:46 +01:00 committed by GitHub
commit 870ec61417
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -3024,6 +3024,16 @@ float _Engine::get_frames_per_second() const {
return Engine::get_singleton()->get_frames_per_second(); return Engine::get_singleton()->get_frames_per_second();
} }
uint64_t _Engine::get_physics_frames() const {
return Engine::get_singleton()->get_physics_frames();
}
uint64_t _Engine::get_idle_frames() const {
return Engine::get_singleton()->get_idle_frames();
}
void _Engine::set_time_scale(float p_scale) { void _Engine::set_time_scale(float p_scale) {
Engine::get_singleton()->set_time_scale(p_scale); Engine::get_singleton()->set_time_scale(p_scale);
} }
@ -3108,6 +3118,8 @@ void _Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_frames_drawn"), &_Engine::get_frames_drawn); ClassDB::bind_method(D_METHOD("get_frames_drawn"), &_Engine::get_frames_drawn);
ClassDB::bind_method(D_METHOD("get_frames_per_second"), &_Engine::get_frames_per_second); ClassDB::bind_method(D_METHOD("get_frames_per_second"), &_Engine::get_frames_per_second);
ClassDB::bind_method(D_METHOD("get_physics_frames"), &_Engine::get_physics_frames);
ClassDB::bind_method(D_METHOD("get_idle_frames"), &_Engine::get_idle_frames);
ClassDB::bind_method(D_METHOD("get_main_loop"), &_Engine::get_main_loop); ClassDB::bind_method(D_METHOD("get_main_loop"), &_Engine::get_main_loop);

View File

@ -747,6 +747,8 @@ public:
int get_target_fps() const; int get_target_fps() const;
float get_frames_per_second() const; float get_frames_per_second() const;
uint64_t get_physics_frames() const;
uint64_t get_idle_frames() const;
int get_frames_drawn(); int get_frames_drawn();