Main Page Namespace List Class Hierarchy Alphabetical List Data Structures File List Namespace Members Data Fields Globals

# ExCOptions.h

Go to the documentation of this file.

    00001 /*
    00002  * ExNihilo 3D Engine
    00003  *
    00004  *  This program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2 of the License, or
    00007  *  (at your option) any later version.
    00008  *
    00009  *  This program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    00012  *  GNU Library General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU General Public License
    00015  *  along with this program; if not, write to the Free Software
    00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    00017  *
    00018  * Please read AUTHORS file !!!
    00019  *
    00020  * $Id: ExCOptions.h,v 1.7 2002/08/14 15:32:32 data Exp $
    00021  *
    00022  */
    00023
    00024 #ifndef __EXCOPTIONS_H
    00025 #define __EXCOPTIONS_H
    00026
    00027 #include <iostream>
    00028 #include <string>
    00029 #include <vector>
    00030
    00031 #include "ExCFile.h"
    00032
    00033 #ifdef UNIX_SRC
    00034 #include <sys/stat.h>
    00035 #include <sys/types.h>
    00036 #endif
    00037
    00038 enum {
    00039         EXC_NORMAL = 1,
    00040         EXC_DEBUG,
    00041         EXC_TRACE,
    00042         EXC_LOG,
    00043         EXC_OPTIONS_ALL,
    00044         EXC_OPTIONS_RELOAD };
    00045
    00046 #ifdef UNIX_SRC
    00047 #define EXNIHILO_REP_NAME "/.exnihilo"
    00048 #else
    00049 #define EXNIHILO_REP_NAME
    00050 #endif
    00051
    00052 class ExCOptions {
    00053         private:
    00054                 int type_of_debug;
    00055                 ExCFile *options_file;
    00056
    00057                 bool load (int);
    00058                 bool create_options_file (void);
    00059
    00060                 int resolution_x;
    00061                 int resolution_y;
    00062                 int rate;
    00063                 int depth;
    00064                 std::string fullscreen;
    00065                 std::string fps;
    00066
    00067                 int debug_style;
    00068         public:
    00069                 ExCOptions ();
    00070                 //~ExCOptions ();
    00071                 bool init (void);
    00072                 bool load (void);
    00073                 bool reload (void);
    00074
    00075                 // for window
    00076                 int getWindowResolutionX (void) { return resolution_x; }
    00077                 int getWindowResolutionY (void) { return resolution_y; }
    00078                 int getWindowDepth (void) { return depth; }
    00079                 int getWindowRate (void) { return rate; }
    00080                 bool getWindowFullscreen (void);
    00081                 bool getWindowShowfps (void);
    00082                 int getDebugStyle (void) { return debug_style; }
    00083 };
    00084
    00085 #endif // __EXCOPTIONS_H