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 00048 #include <OSGGL.h> 00049 00050 #include <OSGFieldContainer.h> 00051 #include <OSGNode.h> 00052 #include <OSGAction.h> 00053 #include <OSGDrawAction.h> 00054 #include "OSGViewport.h" 00055 #include "OSGCamera.h" 00056 #include "OSGWindow.h" 00057 #include "OSGBackground.h" 00058 #include "OSGSolidBackground.h" 00059 00060 OSG_USING_NAMESPACE 00061 00062 00063 /***************************************************************************\ 00064 * Description * 00065 \***************************************************************************/ 00066 00076 /***************************************************************************\ 00077 * Class methods * 00078 \***************************************************************************/ 00079 00080 void SolidBackground::initMethod (void) 00081 { 00082 } 00083 00084 /***************************************************************************\ 00085 * Instance methods * 00086 \***************************************************************************/ 00087 00088 SolidBackground::SolidBackground(void) : 00089 Inherited() 00090 { 00091 } 00092 00093 SolidBackground::SolidBackground(const SolidBackground &source) : 00094 Inherited(source) 00095 { 00096 } 00097 00098 SolidBackground::~SolidBackground(void) 00099 { 00100 } 00101 00102 00103 void SolidBackground::changed(BitVector whichField, UInt32 origin) 00104 { 00105 Inherited::changed(whichField, origin); 00106 } 00107 00108 /*-------------------------- your_category---------------------------------*/ 00109 00110 void SolidBackground::clear(DrawActionBase *, Viewport *) 00111 { 00112 Color3f &col = getColor(); 00113 glClearColor(col[0], col[1], col[2], getAlpha()); 00114 glClearDepth(getDepth()); 00115 00116 Int32 bit = getClearStencilBit(); // 0x0 00117 00118 if (bit >= 0) 00119 { 00120 glClearStencil(bit); 00121 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 00122 } 00123 else 00124 { 00125 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 00126 } 00127 } 00128 00129 /*------------------------------- dump ----------------------------------*/ 00130 00131 void SolidBackground::dump( UInt32 OSG_CHECK_ARG(uiIndent), 00132 const BitVector OSG_CHECK_ARG(bvFlags )) const 00133 { 00134 SLOG << "Dump SolidBackground NI" << std::endl; 00135 } 00136 00137 00138 00139 /*------------------------------------------------------------------------*/ 00140 /* cvs id's */ 00141 00142 #ifdef OSG_SGI_CC 00143 #pragma set woff 1174 00144 #endif 00145 00146 #ifdef OSG_LINUX_ICC 00147 #pragma warning( disable : 177 ) 00148 #endif 00149 00150 namespace 00151 { 00152 static Char8 cvsid_cpp [] = "@(#)$Id: FCTemplate_cpp.h,v 1.13 2002/06/01 10:37:25 vossg Exp $"; 00153 static Char8 cvsid_hpp [] = OSGSOLIDBACKGROUND_HEADER_CVSID; 00154 static Char8 cvsid_inl [] = OSGSOLIDBACKGROUND_INLINE_CVSID; 00155 00156 static Char8 cvsid_fields_hpp[] = OSGSOLIDBACKGROUNDFIELDS_HEADER_CVSID; 00157 } 00158 00159 #ifdef __sgi 00160 #pragma reset woff 1174 00161 #endif 00162 00163
1.5.5