src/Config.h

Go to the documentation of this file.
00001 /* Crown and Cutlass
00002  * Config Object Header
00003  */
00004 
00005 #if !defined ( _CONFIG_H_ )
00006 #define _CONFIG_H_
00007 
00008 #include <string>
00009 
00010 class Config {
00011 public:
00012   // Constructor
00013   Config(const std::string filename);
00014 
00015   // Destructor
00016   ~Config();
00017 
00018   // Make sure the necesary extensions are supported
00019   // Note: this needs to happen after we have an opengl context
00020   bool CheckExtensions();
00021 
00022   // Check to see whether or not to use VBOs
00023   bool CheckVBO();
00024 
00025   // Returns winWidth/Height
00026   int GetWinWidth();
00027   int GetWinHeight();
00028 
00029   // Check to see whether or not to go fullscreen
00030   bool CheckFullscreen();
00031 
00032   // Check to see whether or not to enable the SDL parachute
00033   bool CheckSDLParachute();
00034 
00035   // Check whether or not to compress textures
00036   bool CheckCompressTextures();
00037 
00038   // Get the average number of ticks that should go by between battles
00039   unsigned int GetTicksBetweenBattles();
00040 
00041   // Get the number of OpenAL sources to use
00042   unsigned int GetNumberALSources();
00043 
00044   // Get the debug log mode
00045   bool DebugLogEnabled();
00046 
00047   std::string GetStartingShipType();
00048 
00049   static bool OpenConfig(const std::string filename);
00050   static void CloseConfig();
00051 
00052   static Config *s_config;
00053 
00054 private:
00055   // Window dimensions
00056   int m_winWidth;
00057   int m_winHeight;
00058 
00059   // True is fullscreen, false is windowedd
00060   bool m_fullscreen;
00061 
00062   // Bool for VBO usage
00063   bool m_useVBO;
00064 
00065   // Bool for whether or not to enable the SDL parachute
00066   // Note: This should probably be true unless you want to get a core file
00067   bool m_useSDLParachute;
00068 
00069   // Bool for whether or not to compress textures on load
00070   // Note: This should probably always be true, unless your video card
00071   //   can't handle it
00072   bool m_compressTextures;
00073 
00074   // Get the average number of ticks that should go by between battles
00075   // Note: 20000 is a decent default
00076   unsigned int m_ticksBetweenBattles;
00077 
00078   // Number of OpenAL sources to use
00079   // 16 is way more than enough for now
00080   unsigned int m_numberALSources;
00081 
00082   // Whether or not to enable debug logging
00083   bool m_debugLogMode;
00084 
00085   // Ship type to start with
00086   std::string m_startingShipType;
00087 
00088   // Send config options to logger
00089   void LogConfig();
00090 };
00091 
00092 #endif

Generated on Mon Jan 8 22:34:12 2007 for CrownandCutlass by  doxygen 1.4.7