From 1d43bd0f39a955041b51e8589e8d12da49eb2ba9 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 22 May 2014 13:44:36 +0000 Subject: [PATCH] Reset the state and transform before the end_frame callback (needed for Blender integration) --- panda/src/display/callbackGraphicsWindow.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/src/display/callbackGraphicsWindow.cxx b/panda/src/display/callbackGraphicsWindow.cxx index d89f7bc833..6de33cc9d6 100644 --- a/panda/src/display/callbackGraphicsWindow.cxx +++ b/panda/src/display/callbackGraphicsWindow.cxx @@ -124,6 +124,11 @@ begin_frame(FrameMode mode, Thread *current_thread) { void CallbackGraphicsWindow:: end_frame(FrameMode mode, Thread *current_thread) { if (_render_callback != NULL) { + // In case the callback or the application hosting the OpenGL + // context wants to do more rendering, let's give it a blank slate. + _gsg->set_state_and_transform(RenderState::make_empty(), _gsg->get_internal_transform()); + _gsg->clear_before_callback(); + RenderCallbackData data(this, RCT_end_frame, mode); _render_callback->do_callback(&data); } else {