From 37b172d3d3aeef4f29b300ccb43f7383c3ce4acb Mon Sep 17 00:00:00 2001 From: David Rose Date: Thu, 16 Feb 2006 06:36:23 +0000 Subject: [PATCH] default-stereo-camera --- direct/src/showbase/ShowBase.py | 10 ++++++---- panda/src/framework/config_framework.cxx | 2 ++ panda/src/framework/config_framework.h | 1 + panda/src/framework/windowFramework.cxx | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index ebe656bbff..a0528802df 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -371,8 +371,8 @@ class ShowBase(DirectObject.DirectObject): pipeType.getName())) def openWindow(self, props = None, pipe = None, gsg = None, - type = None, name = None, scene = None, - size = None, aspectRatio = None): + type = None, name = None, size = None, aspectRatio = None, + makeCamera = 1, scene = None, stereo = None): """ Creates a window and adds it to the list of windows that are to be updated every frame. @@ -433,7 +433,9 @@ class ShowBase(DirectObject.DirectObject): self.winList.append(win) # Set up a 3-d camera for the window by default. - self.makeCamera(win, scene = scene, aspectRatio = aspectRatio) + if makeCamera: + self.makeCamera(win, scene = scene, aspectRatio = aspectRatio, + stereo = stereo) return win @@ -803,7 +805,7 @@ class ShowBase(DirectObject.DirectObject): dr.setCamera(cam) if stereo == None: - stereo = win.isStereo() + stereo = (win.isStereo() and self.config.GetBool('default-stereo-camera', 1)) if stereo: # A stereo camera! The first DisplayRegion becomes the # left channel. diff --git a/panda/src/framework/config_framework.cxx b/panda/src/framework/config_framework.cxx index a1e2b3fe81..3c879139d3 100644 --- a/panda/src/framework/config_framework.cxx +++ b/panda/src/framework/config_framework.cxx @@ -34,6 +34,8 @@ ConfigVariableDouble aspect_ratio ("aspect-ratio", 0.0); ConfigVariableBool show_frame_rate_meter ("show-frame-rate-meter", false); +ConfigVariableBool default_stereo_camera +("default-stereo-camera", true); ConfigVariableString record_session ("record-session", ""); diff --git a/panda/src/framework/config_framework.h b/panda/src/framework/config_framework.h index f38a486dc2..1083f51c11 100644 --- a/panda/src/framework/config_framework.h +++ b/panda/src/framework/config_framework.h @@ -31,6 +31,7 @@ NotifyCategoryDecl(framework, EXPCL_FRAMEWORK, EXPTP_FRAMEWORK); // Configure variables for framework package. extern ConfigVariableDouble aspect_ratio; extern ConfigVariableBool show_frame_rate_meter; +extern ConfigVariableBool default_stereo_camera; extern ConfigVariableString record_session; extern ConfigVariableString playback_session; diff --git a/panda/src/framework/windowFramework.cxx b/panda/src/framework/windowFramework.cxx index 035fa0adb5..23e571f49c 100644 --- a/panda/src/framework/windowFramework.cxx +++ b/panda/src/framework/windowFramework.cxx @@ -186,7 +186,7 @@ open_window(const WindowProperties &props, GraphicsEngine *engine, NodePath camera_np = make_camera(); _display_region_3d->set_camera(camera_np); - if (_window->is_stereo()) { + if (_window->is_stereo() && default_stereo_camera) { // Actually, let's make a stereo camera. That means the // _display_region_3d will be the left channel, and we need to // make another one to be the right channel.