From fda3b566b9ae95c3bdff0cfc87d3c94fa3a4ea21 Mon Sep 17 00:00:00 2001
From: Gilles Marckmann <gilles.marckmann@ec-nantes.fr>
Date: Wed, 28 Jul 2010 12:23:57 +0000
Subject: [PATCH] option for stereo

---
 Common/Context.h        | 4 ++--
 Common/DefaultOptions.h | 2 ++
 Common/Options.cpp      | 8 ++++++++
 Common/Options.h        | 1 +
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/Common/Context.h b/Common/Context.h
index 3f5b62f6b1..b479195097 100644
--- a/Common/Context.h
+++ b/Common/Context.h
@@ -125,8 +125,8 @@ class CTX {
   // characteristic length for the whole problem (never used in mesh
   // generation ->only for geo/post)
   double lc;
-  // double buffer/antialias graphics?
-  int db, antialiasing;
+  // double buffer/antialias/stereo graphics?
+  int db, antialiasing, stereo;
   // orthogonal projection? 
   int ortho;
   // draw the bounding boxes and the rot center?
diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h
index 5b0bbf0d01..87228c0c7b 100644
--- a/Common/DefaultOptions.h
+++ b/Common/DefaultOptions.h
@@ -832,6 +832,8 @@ StringXNumber GeneralOptions_Number[] = {
   { F|S, "StatisticsPositionY" , opt_general_statistics_position1 , 150. , 
     "Vertical position (in pixels) of the upper left corner of the statistic"
     " window" }, 
+  { F|O, "Stereo" , opt_general_stereo , 0. ,
+    "Use stereo rendering" },
   { F|S, "SystemMenuBar" , opt_general_system_menu_bar , 1. , 
     "Use the system menu bar on Mac OS X?" }, 
 
diff --git a/Common/Options.cpp b/Common/Options.cpp
index 36d156561f..829da11630 100644
--- a/Common/Options.cpp
+++ b/Common/Options.cpp
@@ -3505,6 +3505,14 @@ double opt_general_antialiasing(OPT_ARGS_NUM)
   return CTX::instance()->antialiasing;
 }
 
+double opt_general_stereo(OPT_ARGS_NUM)
+{
+  if(action & GMSH_SET) {
+    CTX::instance()->stereo = (int)val;
+  }
+  return CTX::instance()->stereo;
+}
+
 double opt_general_alpha_blending(OPT_ARGS_NUM)
 {
   if(action & GMSH_SET)
diff --git a/Common/Options.h b/Common/Options.h
index 0d1975287c..157f3de6e4 100644
--- a/Common/Options.h
+++ b/Common/Options.h
@@ -339,6 +339,7 @@ double opt_general_small_axes_size(OPT_ARGS_NUM);
 double opt_general_quadric_subdivisions(OPT_ARGS_NUM);
 double opt_general_double_buffer(OPT_ARGS_NUM);
 double opt_general_antialiasing(OPT_ARGS_NUM);
+double opt_general_stereo(OPT_ARGS_NUM);
 double opt_general_alpha_blending(OPT_ARGS_NUM);
 double opt_general_vector_type(OPT_ARGS_NUM);
 double opt_general_arrow_head_radius(OPT_ARGS_NUM);
-- 
GitLab