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

glcontext.h

Go to the documentation of this file.
00001 // glcontext.h
00002 //
00003 // Copyright (C) 2003, Chris Laurel <claurel@shatters.net>
00004 //
00005 // This program is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU General Public License
00007 // as published by the Free Software Foundation; either version 2
00008 // of the License, or (at your option) any later version.
00009 
00010 #ifndef _CELENGINE_GLCONTEXT_H_
00011 #define _CELENGINE_GLCONTEXT_H_
00012 
00013 #include <string>
00014 #include <vector>
00015 #include <celengine/vertexprog.h>
00016 #include <celengine/fragmentprog.h>
00017 
00018 class GLContext
00019 {
00020  public:
00021     GLContext();
00022     virtual ~GLContext();
00023 
00024     enum GLRenderPath 
00025     {
00026         GLPath_Basic             = 0,
00027         GLPath_Multitexture      = 1,
00028         GLPath_NvCombiner        = 2,
00029         GLPath_DOT3_ARBVP        = 3,
00030         GLPath_NvCombiner_NvVP   = 4,
00031         GLPath_NvCombiner_ARBVP  = 5,
00032         GLPath_ARBFP_ARBVP       = 6,
00033         GLPath_NV30              = 7,
00034         GLPath_GLSL              = 8,
00035     };
00036 
00037     enum VertexPath
00038     {
00039         VPath_Basic              = 0,
00040         VPath_NV                 = 1,
00041         VPath_ARB                = 2,
00042     };
00043 
00044     void init(const std::vector<std::string>& ignoreExt);
00045     
00046     GLRenderPath getRenderPath() const { return renderPath; };
00047     bool setRenderPath(GLRenderPath);
00048     bool renderPathSupported(GLRenderPath) const;
00049     GLRenderPath nextRenderPath();
00050 
00051     bool extensionSupported(const std::string&) const;
00052 
00053     int getMaxTextures() const { return maxSimultaneousTextures; };
00054     bool hasMultitexture() const { return renderPath >= GLPath_Multitexture; };
00055     bool bumpMappingSupported() const;
00056 
00057     VertexPath getVertexPath() const;
00058 
00059     VertexProcessor* getVertexProcessor() const;
00060     FragmentProcessor* getFragmentProcessor() const;
00061 
00062  private:
00063     GLRenderPath renderPath;
00064     VertexPath vertexPath;
00065     VertexProcessor* vertexProc;
00066     FragmentProcessor* fragmentProc;
00067 
00068     int maxSimultaneousTextures;
00069     std::vector<std::string> extensions;
00070 };
00071 
00072 #endif // _CELENGINE_GLCONTEXT_H_
00073 

Generated on Sat Jan 14 22:30:27 2006 for Celestia by  doxygen 1.4.1