diff --git a/panda/src/framework/config_framework.cxx b/panda/src/framework/config_framework.cxx index b03c661b56..7c49fa3113 100644 --- a/panda/src/framework/config_framework.cxx +++ b/panda/src/framework/config_framework.cxx @@ -30,6 +30,8 @@ ConfigVariableDouble aspect_ratio ("aspect-ratio", 0.0); ConfigVariableBool show_frame_rate_meter ("show-frame-rate-meter", false); +ConfigVariableBool show_scene_graph_analyzer_meter +("show-scene-graph-analyzer-meter", false); ConfigVariableString window_type ("window-type", "onscreen"); diff --git a/panda/src/framework/config_framework.h b/panda/src/framework/config_framework.h index ebff70dd95..1cec0ac1e9 100644 --- a/panda/src/framework/config_framework.h +++ b/panda/src/framework/config_framework.h @@ -27,6 +27,7 @@ NotifyCategoryDecl(framework, EXPCL_FRAMEWORK, EXPTP_FRAMEWORK); // Configure variables for framework package. extern ConfigVariableDouble aspect_ratio; extern ConfigVariableBool show_frame_rate_meter; +extern ConfigVariableBool show_scene_graph_analyzer_meter; extern ConfigVariableString record_session; extern ConfigVariableString playback_session; diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index ccd995d1f6..0b5f608d23 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -184,6 +184,10 @@ open_window(const WindowProperties &props, int flags, GraphicsEngine *engine, _frame_rate_meter = new FrameRateMeter("frame_rate_meter"); _frame_rate_meter->setup_window(_window); } + if (show_scene_graph_analyzer_meter) { + _scene_graph_analyzer_meter = new SceneGraphAnalyzerMeter("scene_graph_analyzer_meter", get_render().node()); + _scene_graph_analyzer_meter->setup_window(_window); + } } return _window; @@ -220,6 +224,10 @@ close_window() { _frame_rate_meter->clear_window(); _frame_rate_meter = (FrameRateMeter *)NULL; } + if (_scene_graph_analyzer_meter != (SceneGraphAnalyzerMeter *)NULL) { + _scene_graph_analyzer_meter->clear_window(); + _scene_graph_analyzer_meter = (SceneGraphAnalyzerMeter *)NULL; + } } //////////////////////////////////////////////////////////////////// diff --git a/panda/src/framework/windowFramework.h b/panda/src/framework/windowFramework.h index c695fdce9a..bc7be0adb0 100644 --- a/panda/src/framework/windowFramework.h +++ b/panda/src/framework/windowFramework.h @@ -24,6 +24,7 @@ #include "trackball.h" #include "filename.h" #include "frameRateMeter.h" +#include "sceneGraphAnalyzerMeter.h" #include "pointerTo.h" #include "partGroup.h" #include "pvector.h" @@ -197,6 +198,7 @@ private: bool _perpixel_enabled; PT(FrameRateMeter) _frame_rate_meter; + PT(SceneGraphAnalyzerMeter) _scene_graph_analyzer_meter; BackgroundType _background_type;