Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

openglserver.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*-
00002 
00003    this file is part of rcssserver3D
00004    Fri May 9 2003
00005    Copyright (C) 2002,2003 Koblenz University
00006    Copyright (C) 2003 RoboCup Soccer Server 3D Maintenance Group
00007    $Id: openglserver.h,v 1.9 2004/04/12 13:28:25 rollmark Exp $
00008 
00009    This program is free software; you can redistribute it and/or modify
00010    it under the terms of the GNU General Public License as published by
00011    the Free Software Foundation; version 2 of the License.
00012 
00013    This program is distributed in the hope that it will be useful,
00014    but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016    GNU General Public License for more details.
00017 
00018    You should have received a copy of the GNU General Public License
00019    along with this program; if not, write to the Free Software
00020    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00021 */
00022 #ifndef KEROSIN_OPENGLSERVER_H
00023 #define KEROSIN_OPENGLSERVER_H
00024 
00025 // #ifdef HAVE_CONFIG_H
00026 // #include "config.h"
00027 // #endif
00028 
00029 #include <zeitgeist/class.h>
00030 #include <zeitgeist/leaf.h>
00031 #include "glextensionreg.h"
00032 #include <set>
00033 
00034 namespace kerosin
00035 {
00036 #if 0
00037 }
00038 #endif
00039 
00040 class MapHolder;
00041 
00042 class OpenGLServer : public zeitgeist::Leaf
00043 {
00044     //
00045     // types
00046     //
00047 protected:
00049 // #if HAVE_HASH_MAP
00050 //     typedef std::hash_map<std::string, unsigned int> TProgramCache;
00051 // #else
00052 //     typedef std::map<std::string, unsigned int> TProgramCache;
00053 // #endif
00054 
00056     typedef std::set<int> TLightSet;
00057 
00058     //
00059     // functions
00060     //
00061 public:
00062     OpenGLServer();
00063     ~OpenGLServer();
00064 
00065     boost::shared_ptr<GLExtensionReg> GetExtensionReg() const;
00067     void Quit();
00068 
00070     bool WantsToQuit() const;
00071 
00073     void Update();
00074 
00076     void SwapBuffers() const;
00077 
00079     unsigned int LoadARBProgram(GLenum target, const char* fileName);
00080 
00082     unsigned int LoadARBVertexProgram(const char* fileName);
00083 
00085     unsigned int LoadARBFragmentProgram(const char* fileName);
00086 
00087     bool SupportsFancyLighting() const { return mSupportsFancyLighting; }
00088     void ToggleFancyLighting();
00089 
00093     int AllocLight();
00094 
00096     void PutLight(int l);
00097 
00098 protected:
00100     virtual bool ConstructInternal();
00101 
00102     //
00103     // members
00104     //
00105 protected:
00107     boost::shared_ptr<GLExtensionReg> mExtensionReg;
00108 
00110     bool mWantsToQuit;
00111 
00113     boost::shared_ptr< MapHolder > mHolder;
00114 
00116     bool mSupportsFancyLighting;
00117 
00119     TLightSet mAvailableLights;
00120 };
00121 
00122 DECLARE_CLASS(OpenGLServer);
00123 
00124 } //namespace kerosin
00125 
00126 #endif //KEROSIN_OPENGLSERVER_H

Generated on Thu Apr 6 15:25:39 2006 for rcssserver3d by  doxygen 1.4.4