Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGGLUTWindow.cpp

Go to the documentation of this file.
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 #ifdef OSG_WITH_GLUT
00040 
00041 //---------------------------------------------------------------------------
00042 //  Includes
00043 //---------------------------------------------------------------------------
00044 
00045 #include <stdlib.h>
00046 #include <stdio.h>
00047 
00048 #include <OSGConfig.h>
00049 
00050 #define OSG_COMPILEWINDOWGLUTINST
00051 
00052 #include "OSGGLUTWindow.h"
00053 
00054 #include <OSGGLUT.h>
00055 
00056 #include "OSGNodePtr.h"
00057 #include "OSGViewport.h"
00058 #include "OSGCamera.h"
00059 #include "OSGBackground.h"
00060 #include "OSGGLUTWindow.h"
00061 
00062 OSG_USING_NAMESPACE
00063 
00070 /*----------------------- constructors & destructors ----------------------*/
00071 
00073 
00074 GLUTWindow::GLUTWindow(void) :
00075     Inherited()
00076 {
00077 }
00078 
00080 
00081 GLUTWindow::GLUTWindow(const GLUTWindow &source) :
00082     Inherited(source)
00083 {
00084 }
00085 
00087 
00088 GLUTWindow::~GLUTWindow(void)
00089 {
00090 }
00091 
00092 /*----------------------------- class specific ----------------------------*/
00093 
00095 
00096 void GLUTWindow::initMethod (void)
00097 {
00098 }
00099 
00101 
00102 void GLUTWindow::changed(BitVector whichField, UInt32 origin)
00103 {
00104     Inherited::changed(whichField, origin);
00105 }
00106 
00108 
00109 void GLUTWindow::dump(      UInt32    , 
00110                       const BitVector ) const
00111 {
00112     SLOG << "Dump GLUTWindow NI" << std::endl;
00113 }
00114     
00115 /* ------------- Window functions -----------------------*/    
00116     
00117 // init the window: create the context  
00118 void GLUTWindow::init(void)
00119 {
00120     activate();
00121     setupGL();
00122 }
00123     
00124 // activate the window: bind the OGL context    
00125 void GLUTWindow::activate(void)
00126 {
00127     if(glutGetWindow() != getId())
00128         glutSetWindow(getId());
00129 }
00130     
00131 // deactivate the window  
00132 void GLUTWindow::deactivate(void)
00133 {
00134 }
00135     
00136 // swap front and back buffers  
00137 void GLUTWindow::swap(void)
00138 {
00139     glutSwapBuffers();
00140 }
00141 
00142 #endif // OSG_WITH_GLUT
00143 
00144 
00145 /*-------------------------------------------------------------------------*/
00146 /*                              cvs id's                                   */
00147 
00148 #ifdef __sgi
00149 #pragma set woff 1174
00150 #endif
00151 
00152 #ifdef OSG_LINUX_ICC
00153 #pragma warning( disable : 177 )
00154 #endif
00155 
00156 namespace
00157 {
00158     static char cvsid_cpp[] = "@(#)$Id: $";
00159     static char cvsid_hpp[] = OSGGLUTWINDOW_HEADER_CVSID;
00160     static char cvsid_inl[] = OSGGLUTWINDOW_INLINE_CVSID;
00161 
00162     static Char8 cvsid_fields_hpp[] = OSGGLUTWINDOWFIELDS_HEADER_CVSID;
00163 }

Generated on Thu Aug 25 04:05:25 2005 for OpenSG by  doxygen 1.4.3