00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KEROSIN_OPENGLSERVER_H
00023 #define KEROSIN_OPENGLSERVER_H
00024
00025
00026
00027
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
00046
00047 protected:
00049
00050
00051
00052
00053
00054
00056 typedef std::set<int> TLightSet;
00057
00058
00059
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
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 }
00125
00126 #endif //KEROSIN_OPENGLSERVER_H