00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 by the OpenSG Forum * 00006 * * 00007 * www.opensg.org * 00008 * * 00009 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00010 * * 00011 \*---------------------------------------------------------------------------*/ 00012 /*---------------------------------------------------------------------------*\ 00013 * License * 00014 * * 00015 * This library is free software; you can redistribute it and/or modify it * 00016 * under the terms of the GNU Library General Public License as published * 00017 * by the Free Software Foundation, version 2. * 00018 * * 00019 * This library is distributed in the hope that it will be useful, but * 00020 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00022 * Library General Public License for more details. * 00023 * * 00024 * You should have received a copy of the GNU Library General Public * 00025 * License along with this library; if not, write to the Free Software * 00026 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00027 * * 00028 \*---------------------------------------------------------------------------*/ 00029 /*---------------------------------------------------------------------------*\ 00030 * Changes * 00031 * * 00032 * * 00033 * * 00034 * * 00035 * * 00036 * * 00037 \*---------------------------------------------------------------------------*/ 00038 00039 //--------------------------------------------------------------------------- 00040 // Includes 00041 //--------------------------------------------------------------------------- 00042 00043 #include <stdlib.h> 00044 #include <stdio.h> 00045 00046 #include <OSGConfig.h> 00047 #include <OSGGL.h> 00048 00049 #include "OSGNodePtr.h" 00050 #include "OSGStereoBufferViewport.h" 00051 00052 OSG_USING_NAMESPACE 00053 00054 /***************************************************************************\ 00055 * Description * 00056 \***************************************************************************/ 00057 00069 /*----------------------- constructors & destructors ----------------------*/ 00070 00071 StereoBufferViewport::StereoBufferViewport(void) : 00072 Inherited() 00073 { 00074 } 00075 00076 StereoBufferViewport::StereoBufferViewport(const StereoBufferViewport &source) : 00077 Inherited(source) 00078 { 00079 } 00080 00081 StereoBufferViewport::~StereoBufferViewport(void) 00082 { 00083 } 00084 00085 /*----------------------------- class specific ----------------------------*/ 00086 00087 void StereoBufferViewport::initMethod (void) 00088 { 00089 } 00090 00091 void StereoBufferViewport::changed(BitVector whichField, UInt32 origin) 00092 { 00093 Inherited::changed(whichField, origin); 00094 } 00095 00096 void StereoBufferViewport::dump( UInt32 , 00097 const BitVector ) const 00098 { 00099 SLOG << "Dump StereoBufferViewport NI" << std::endl; 00100 } 00101 00102 void StereoBufferViewport::activateSize(void) 00103 { 00104 Inherited::activateSize(); 00105 } 00106 00107 void StereoBufferViewport::activate(void) 00108 { 00109 if(getLeftBuffer()) 00110 { 00111 if(getRightBuffer()) 00112 { 00113 glDrawBuffer(GL_BACK); 00114 glReadBuffer(GL_BACK); 00115 } 00116 else 00117 { 00118 glDrawBuffer(GL_BACK_LEFT); 00119 glReadBuffer(GL_BACK_LEFT); 00120 } 00121 } 00122 else 00123 { 00124 if(getRightBuffer()) 00125 { 00126 glDrawBuffer(GL_BACK_RIGHT); 00127 glReadBuffer(GL_BACK_RIGHT); 00128 } 00129 else 00130 { 00131 glDrawBuffer(GL_NONE); 00132 glReadBuffer(GL_NONE); 00133 } 00134 } 00135 Inherited::activate(); 00136 } 00137 00138 void StereoBufferViewport::deactivate(void) 00139 { 00140 Inherited::deactivate(); 00141 glDrawBuffer(GL_BACK); 00142 glReadBuffer(GL_BACK); 00143 } 00144 00145 void StereoBufferViewport::draw( DrawAction * action ) 00146 { 00147 Inherited::draw(action); 00148 } 00149 00150 void StereoBufferViewport::render(RenderActionBase *action) 00151 { 00152 Inherited::render(action); 00153 } 00154 00155 00156 /*-------------------------------------------------------------------------*/ 00157 /* cvs id's */ 00158 00159 #ifdef __sgi 00160 #pragma set woff 1174 00161 #endif 00162 00163 #ifdef OSG_LINUX_ICC 00164 #pragma warning( disable : 177 ) 00165 #endif 00166 00167 namespace 00168 { 00169 static char cvsid_cpp[] = "@(#)$Id: $"; 00170 static char cvsid_hpp[] = OSGSTEREOBUFFERVIEWPORT_HEADER_CVSID; 00171 static char cvsid_inl[] = OSGSTEREOBUFFERVIEWPORT_INLINE_CVSID; 00172 }
1.5.5