#include <Parameters.h>
Public Member Functions | |
void | Setup (CDXUTDialog *g_HUD) |
You can set the dialog that manages input and rendering for the GUI controls. | |
void | Setup (CDXUTDialog *g_HUD, ONCHANGE_CALLBACK OnReset, ONCHANGE_CALLBACK OnSave=OnChange, ONCHANGE_CALLBACK OnLoad=OnChange) |
You can set the dialog that manages input and rendering for the GUI controls. | |
bool | Get (bool_t i) |
Returns value of the specified boolean parameter, e.g. Get( bShowHelp ). | |
float | Get (number_t i) |
Returns float value of the specified numeric parameter, in range 0..1. | |
int | GetInt (number_t i) |
Returns integer value of the specified numeric parameter, in range 0...number-of-steps. | |
void | SetBool (bool_t ID, bool b) |
void | SetFloat (number_t ID, float v) |
void | SetInt (number_t ID, int v) |
void | Add (bool_t ID, char *label, char cHotKey=0, ONCHANGE_CALLBACK bchf=OnChange) |
Adds a boolean parameter represented by a GUI checkbox. Specifies hotkey and callback function. | |
void | Add (int radiogroupID, bool_t ID, char *label, char cHotKey=0, ONCHANGE_CALLBACK bchf=OnChange) |
Adds a boolean parameter represented by a GUI radio button. Specifies hotkey and callback function. | |
void | Add (number_t ID, char *label, int num_steps) |
Adds a numeric parameter represented by a GUI slider. | |
void | Add (number_t ID, char *label, int num_steps, CONVERTER ff, ONCHANGE_CALLBACK chf=OnChange) |
Adds a numeric parameter represented by a GUI slider. Specifies callback functions. | |
void | Add (number_t ID, char *label, int num_steps, char cKeyDecr, char cKeyIncr=0, CONVERTER ff=noconvert, ONCHANGE_CALLBACK chf=OnChange) |
Adds a numeric parameter represented by a GUI slider. Specifies hotkeys and callback functions. | |
void | SetEnabled (bool_t ID, bool bEnabled) |
void | SetEnabled (number_t ID, bool bEnabled) |
void | UpdateFromHUD (int controlID) |
Updates the specified parameter from the GUI. | |
void | SaveToFile (char *fileName) |
Writes all parameter values into the specified file. | |
void | LoadFromFile (char *fileName) |
Loads all parameter values from the specified file. | |
Private Attributes | |
bool | bparam [LAST_BOOL] |
wchar_t | bname [LAST_BOOL][CHARBUFFER_SIZE] |
int | radiogroup [LAST_BOOL] |
int | param [LAST_NUMBER] |
wchar_t | name [LAST_NUMBER][CHARBUFFER_SIZE] |
int | numsteps [LAST_NUMBER] |
bool | rotate [LAST_NUMBER] |
CONVERTER | ffunc [LAST_NUMBER] |
ONCHANGE_CALLBACK | chfunc [LAST_NUMBER+3] |
ONCHANGE_CALLBACK | bchfunc [LAST_BOOL] |
CDXUTDialog * | g_HUD |
Manages input and rendering for the GUI controls. | |
bool | bSilent |
Static Private Attributes | |
static const int | CHARBUFFER_SIZE = 200 |
The max length of a line in the saved file. |
You can easily add numeric/boolean parameters represented by GUI sliders and checkboxes/radio buttons. Then get the current values of these parameters when needed. All parameters can be saved to file or read from file in one step.
The following rendering methods (method_t) are defined here:
Uses technique EnvMapClassicPS() (or EnvMapClassicMetalPS() for metals).
Uses technique EnvMapImpostorPS() (or EnvMapImpostorMetalPS() for metals).
Uses technique EnvMapDiffusePS() for rendering and EnvMap::PreConvolve() for precalculation.
Uses technique EnvMapDiffuseLocalizedWithCosLookupPS() for rendering and EnvMap::GenerateCosTexture() for precalculation.
Sorry for the long function names ;)
Uses technique EnvMapDiffuseLocalizedPS().
|
Adds a numeric parameter represented by a GUI slider. Specifies hotkeys and callback functions.
|
|
Adds a numeric parameter represented by a GUI slider. Specifies callback functions.
|
|
Adds a numeric parameter represented by a GUI slider.
|
|
Adds a boolean parameter represented by a GUI radio button. Specifies hotkey and callback function.
|
|
Adds a boolean parameter represented by a GUI checkbox. Specifies hotkey and callback function.
|
|
Returns float value of the specified numeric parameter, in range 0..1. Example: Get( refractionIndex ). Converter functions (if present) are applied to the result. |
|
Returns value of the specified boolean parameter, e.g. Get( bShowHelp ).
|
|
Returns integer value of the specified numeric parameter, in range 0...number-of-steps. Example: Get( fIntensity ) = 0..100. Converter functions (if present) are applied to the result. |
|
Loads all parameter values from the specified file.
|
|
Writes all parameter values into the specified file.
|
|
|
|
|
|
|
|
|
|
|
|
You can set the dialog that manages input and rendering for the GUI controls. Additionally, you can specify actions (ONCHANGE_CALLBACK) to the standard buttons Reset, Save and Load. |
|
You can set the dialog that manages input and rendering for the GUI controls.
|
|
Updates the specified parameter from the GUI. Since a GUI event provides the id of the sender (see OnGUIEvent() in Main.cpp), we can update the parameter value belonging to that control. In case of Load/Save, parameters are loaded from/saved to the file called .params. In case of Reset, parameters are loaded from the file called .params0. |
|
|
|
|
|
|
|
|
|
The max length of a line in the saved file.
|
|
|
|
|
|
Manages input and rendering for the GUI controls.
|
|
|
|
|
|
|
|
|
|
|