class MASKING_DLL_DECLSPEC Settings

Stores all the settings and preferences for a MASkinG application.

Public Fields

[more]static char skinPath[1024]
Path to the skin file the GUI should use
[more]static int screenWidth
Screen or window width
[more]static int screenHeight
Screen or window height
[more]static int gfxMode
The gfx mode constant.
[more]static bool fullscreen
Should the GUI run in fullscreen or windowed?
[more]static int colorDepth
The color depth in fullscreen mode.
[more]static int refreshRate
The requested monitor refresh rate in fullscreen mode.
[more]static bool useVideoMemory
Should we use hardware acceleration with video bitmaps?
[more]static bool fullDrag
Show window contents while dragging?
[more]static bool fullResize
Show window contents while resizing?
[more]static int logicFrameRate
The frame rate of the GUI logic loop.
[more]static bool unlimitedFrameRate
Should the GUI redraw itself as fast as possible or should the redraw frame rate be clipped to the logic frame rate?
[more]static bool showFrameRate
Should we display FPS?
[more]static bool antialiasing
Use antialiasing for text output?
[more]static bool guiSound
Enable/disable GUI sounds
[more]static int soundVolume
Volume of the rollover sounds
[more]static int soundDriver
The sound driver ID.
[more]static int midiDriver
The midi driver ID.
[more]static bool showMouse
Should the GUI use the mouse or not?
[more]static bool mouseShadow
Should we render the mouse shadow or not?
[more]static int doubleClickDelay
Double click delay in miliseconds
[more]static int mouseSpeed
The speed at which the mouse cursor moves.
[more]static bool useKeyboard
Should the GUI handle keyboard input?
[more]static int keyDelay
The keyboard delay in miliseconds.
[more]static int keyRepeat
The keyboard repeat rate.
[more]static bool useJoystick
Should the GUI use the joystick for simulating keybord input?
[more]static int screenUpdateMethod
Which screen update driver to use?
[more]static bool vsync
Should the driver wait for vsync or not?
[more]static bool yield
Should the GUI yield timeslices when idle?
[more]static bool runInBackground
Should the program keep running while tabbed away?
[more]static int maxFrameSkip
Maximum number of logic frames that are processed before a frame is skipped if the computer is too slow to run the logic at the requested logic frame rate.
[more]static int tooltipDelay
The tooltip delay in miliseconds.
[more]static int tooltipAutohideDelay
The delay before a tooltip automatically hides itself
[more]static int scrollingSpeed
The scrooling speed of the mouse wheel as number of items scrolled at a time
[more]static int gfxFrameRate
Target graphics frame rate.

Public Methods

[more]static void Load(const char* fileName)
Attempts to load the settings from the given config file.
[more]static void Save()
Saves all the settings to the file from which they were read


Documentation

Stores all the settings and preferences for a MASkinG application. It has functions for reading the values from an Allegro config file and writing them back. If settings can't be read from the given file, sensible default values are provided. All the data and methods are static so this acts more as a namespace for various preferences that would otherwise be global.
ostatic char skinPath[1024]
Path to the skin file the GUI should use

ostatic int screenWidth
Screen or window width

ostatic int screenHeight
Screen or window height

ostatic int gfxMode
The gfx mode constant. This is platform dependant. You should see the allegro.cfg file in the Allegro root directory for a list of all available constants for each platform. Normally this should be one of the GFX_AUTODETECT constants. In that case the fullscreen variable (see below) is used to determine whether GFX_AUTODETECT_FULLSCREEN or GFX_AUTODETECT_WINDOWED should be used. In any other case this setting overrides the fullscreen flag. The default it GFX_AUTODETECT.

ostatic bool fullscreen
Should the GUI run in fullscreen or windowed? Set to true if the program should run in fullscreen, to false otherwise. This only has effect when gfxMode is set to anything other than one of the GFX_AUTODETECT constants, otherwise it is ignored.

ostatic int colorDepth
The color depth in fullscreen mode. In windowed modes the desktop color depth is used instead.

ostatic int refreshRate
The requested monitor refresh rate in fullscreen mode. Actual refresh rate depends on the current platform and hardware.

ostatic bool useVideoMemory
Should we use hardware acceleration with video bitmaps? Set to true if you want the GUI to use video memory for holding skin data and the screen buffers. This can improve performance significantly in some configurations but doesn't always seem to work for some reason.

Note: this is currently disabled!

ostatic bool fullDrag
Show window contents while dragging?

Note: not currently implemented.

ostatic bool fullResize
Show window contents while resizing?

Note: not currently implemented.

ostatic int logicFrameRate
The frame rate of the GUI logic loop. The default is 50 and should do in most cases.

ostatic bool unlimitedFrameRate
Should the GUI redraw itself as fast as possible or should the redraw frame rate be clipped to the logic frame rate? Setting this to true may yield smoother animation on slower computers but can hog 100% of the CPU power.

ostatic bool showFrameRate
Should we display FPS? Note that this currently has no meaning to the core of the GUI as the GUI itself doesn't print FPS in any way. This can be used by the user though to determine whether the fps should be displayed or not.

ostatic bool antialiasing
Use antialiasing for text output? Antialiased text looks a lot better than normal text but is also somewhat slower especially when drawing to video memory.

ostatic bool guiSound
Enable/disable GUI sounds

ostatic int soundVolume
Volume of the rollover sounds

ostatic int soundDriver
The sound driver ID. See allegro.cfg in the Allegro direcotry for a list of all possible drivers on each platform. Default is DIGI_AUTODETECT.

ostatic int midiDriver
The midi driver ID. See allegro.cfg in the Allegro direcotry for a list of all possible drivers on each platform. Default is MIDI_AUTODETECT.

ostatic bool showMouse
Should the GUI use the mouse or not? This doesn't just hide the mouse cursor but disables mouse tracking comepletely. But the Allegro mouse module is still installed even if showMouse is false, this setting enables you to dynamically turn the mouse on and off during the execution of the program.

ostatic bool mouseShadow
Should we render the mouse shadow or not? Generating mouse shadow can take quite a lot of time especially if you use large animated cursors (several seconds on slower systems) and drawing them is quite slow too, especially on video memory. Mouse shadow are automatically disabled in 8 bpp mode.

ostatic int doubleClickDelay
Double click delay in miliseconds

ostatic int mouseSpeed
The speed at which the mouse cursor moves. Higher values make the cursor move slower. Default is 2.

Note: only seems to work on some platforms.

ostatic bool useKeyboard
Should the GUI handle keyboard input? If turned off joystick input will be turned off too as it is simulated as keyboard input.

ostatic int keyDelay
The keyboard delay in miliseconds. If set to -1, keyboard delay will not be altered and whatever is the default on the currecnt platform will be used.

ostatic int keyRepeat
The keyboard repeat rate. If set to -1, keyboard repeat will not be altered and whatever is the default on the currecnt platform will be used.

ostatic bool useJoystick
Should the GUI use the joystick for simulating keybord input?

ostatic int screenUpdateMethod
Which screen update driver to use? Possible options are:
      0 - double buffering
      1 - page flipping
      2 - triple buffering
      3 - dirty rectangles system (DRS)

ostatic bool vsync
Should the driver wait for vsync or not? This only applies to the double buffering driver.

ostatic bool yield
Should the GUI yield timeslices when idle? This significantly reduces the CPU usage but also reduces the performance a bit. Set to true for normal applications that run in a window and when running on a laptop and set to false for games that run in fullscreen and require all the CPU power they can get.

ostatic bool runInBackground
Should the program keep running while tabbed away? If true the program will try to continue to run even when tabbed away. This is done by passing SWITCH_BACKGROUND to set_display_switch_mode() after the graphics mode is set. Note that this setting doesn't take effect immediately, only when the graphics mode is changed (i.e. when calling InstallMAskinG() or ChangeResolution()). The default is true.

ostatic int maxFrameSkip
Maximum number of logic frames that are processed before a frame is skipped if the computer is too slow to run the logic at the requested logic frame rate. This is extremely rare as modern CPUs are easily powerfull enough to process even the most demanding logic at a very high frame rate and the rendering will be the bottleneck but if you run a program with very complex logic on a very slow CPU, this variable will make sure that even though all the logic won't be processed at the desired frame rate (i.e. time will appear to be stretched and the physics won't be accurate), the program will at least run. The value of this variable determines how fast frames will be skipped. The lower this value, the smoother will the program run as more frames will be skipped. Make this value higher and the program will skip less frames but will be choppier on slow CPUs. The optimal values are probably around 5-10. The default is 5.

ostatic int tooltipDelay
The tooltip delay in miliseconds. This is the time the mouse has to be completely still before a tooltip help bubble is shown. The default is 200.

ostatic int tooltipAutohideDelay
The delay before a tooltip automatically hides itself

ostatic int scrollingSpeed
The scrooling speed of the mouse wheel as number of items scrolled at a time

ostatic int gfxFrameRate
Target graphics frame rate. If unlimitedFrameRate is set to false, the screen will be updated no faster as this setting defines, otherwise it has no effect.

ostatic void Load(const char* fileName)
Attempts to load the settings from the given config file. If a value can't be read, the default is used.

ostatic void Save()
Saves all the settings to the file from which they were read


This class has no child classes.

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++