llpaneldisplay.h

Go to the documentation of this file.
00001 
00032 #ifndef LL_LLPANELDISPLAY_H
00033 #define LL_LLPANELDISPLAY_H
00034 
00035 #include "llpanel.h"
00036 #include "llwindow.h"
00037 #include "llcontrol.h"
00038 
00039 class LLSlider;
00040 class LLSpinCtrl;
00041 class LLCheckBoxCtrl;
00042 class LLRadioGroup;
00043 class LLComboBox;
00044 class LLLineEditor;
00045 class LLSliderCtrl;
00046 class LLTextBox;
00047 class LLTextEditor;
00048 
00049 typedef enum
00050 {
00051         GS_LOW_GRAPHICS,
00052         GS_MID_GRAPHICS,
00053         GS_HIGH_GRAPHICS,
00054         GS_ULTRA_GRAPHICS
00055 
00056 } EGraphicsSettings;
00057 
00058 class LLPanelDisplay 
00059 : public LLPanel
00060 {
00061         friend class LLPreferenceCore;
00062         
00063 public:
00064         LLPanelDisplay();
00065         virtual ~LLPanelDisplay();
00066 
00067         virtual BOOL postBuild();
00068 
00069         void refresh(); // Refresh enable/disable
00070         void refreshEnabledState();
00071         void disableUnavailableSettings();
00072         void setHiddenGraphicsState(bool isHidden);
00073         void apply();   // Apply the changed values.
00074         void applyResolution();
00075         void applyWindowSize();
00076         void cancel();
00077         
00078 protected:
00079         void initWindowSizeControls();
00080         bool extractWindowSizeFromString(const char *sInput, U32 &width, U32 &height);
00081         
00082         // aspect ratio sliders and boxes
00083         LLComboBox              *mCtrlFullScreen;               // Fullscreen resolution
00084         LLCheckBoxCtrl  *mCtrlAutoDetectAspect;                 // automatically detect aspect ratio
00085         LLComboBox              *mCtrlAspectRatio;                              // user provided aspect ratio
00086 
00087         LLCheckBoxCtrl  *mCtrlWindowed;                                 // windowed mode
00088         LLComboBox      *mCtrlWindowSize;               // window size for windowed mode
00089 
00091         LLSliderCtrl    *mCtrlSliderQuality;
00092         LLCheckBoxCtrl  *mCtrlCustomSettings;
00093 
00094         // performance sliders and boxes
00095         LLViewBorder    *mGraphicsBorder;
00096 
00097         LLSliderCtrl    *mCtrlDrawDistance;                             // the draw distance slider
00098         LLSliderCtrl    *mCtrlLODFactor;                                // LOD for volume objects
00099         LLSliderCtrl    *mCtrlFlexFactor;                               // Timeslice for flexible objects
00100         LLSliderCtrl    *mCtrlTreeFactor;                               // Control tree cutoff distance
00101         LLSliderCtrl    *mCtrlAvatarFactor;                             // LOD for avatars
00102         LLSliderCtrl    *mCtrlTerrainFactor;                    // LOD for terrain
00103         LLSliderCtrl    *mCtrlSkyFactor;                                // LOD for terrain
00104         LLSliderCtrl    *mCtrlMaxParticle;                              // Max Particle
00105         LLSliderCtrl    *mCtrlPostProcess;                              // Max Particle
00106 
00107         LLCheckBoxCtrl  *mCtrlBumpShiny;
00108         LLCheckBoxCtrl  *mCtrlReflections;
00109         LLCheckBoxCtrl  *mCtrlWindLight;
00110         LLCheckBoxCtrl  *mCtrlAvatarVP;
00111         LLCheckBoxCtrl  *mCtrlShaderEnable;
00112         LLCheckBoxCtrl  *mCtrlAvatarImpostors;
00113         LLCheckBoxCtrl  *mCtrlAvatarCloth;
00114         LLRadioGroup    *mRadioLightingDetail2;
00115 
00116         LLRadioGroup    *mRadioTerrainDetail;
00117         LLRadioGroup    *mRadioReflectionDetail;
00118 
00119         LLTextBox               *mAspectRatioLabel1;
00120         LLTextBox               *mDisplayResLabel;
00121         LLTextEditor    *mFullScreenInfo;
00122         LLTextBox       *mWindowSizeLabel;
00123         
00124         LLTextBox               *mShaderText;
00125         LLTextBox               *mReflectionText;
00126         LLTextBox               *mAvatarText;
00127         LLTextBox               *mTerrainText;
00128         LLTextBox               *mLightingText;
00129         LLTextBox               *mDrawDistanceMeterText1;
00130         LLTextBox               *mDrawDistanceMeterText2;
00131 
00132         LLTextBox               *mMeshDetailText;
00133         LLTextBox               *mLODFactorText;
00134         LLTextBox               *mFlexFactorText;
00135         LLTextBox               *mTreeFactorText;
00136         LLTextBox               *mAvatarFactorText;
00137         LLTextBox               *mTerrainFactorText;
00138         LLTextBox               *mSkyFactorText;
00139         LLTextBox               *mPostProcessText;
00140 
00141         BOOL mFSAutoDetectAspect;
00142         F32 mAspectRatio;
00143 
00144         // performance value holders for cancel
00145 
00146         S32 mQualityPerformance;
00147         BOOL mCustomSettings;
00148 
00149         BOOL mBumpShiny;
00150         BOOL mShaderEnable;
00151         BOOL mWindLight;
00152         BOOL mReflections;
00153         BOOL mAvatarVP;
00154 
00155         S32 mReflectionDetail;
00156 
00157         BOOL mAvatarImpostors;
00158         BOOL mAvatarCloth;
00159         S32 mAvatarMode;
00160         S32 mLightingDetail;
00161         S32 mTerrainDetail;
00162 
00163         F32 mRenderFarClip;
00164         F32 mPrimLOD;
00165         F32 mFlexLOD;
00166         F32 mTreeLOD;
00167         F32 mAvatarLOD;
00168         F32 mTerrainLOD;
00169         S32 mSkyLOD;
00170         S32 mParticleCount;
00171         S32 mPostProcess;
00172 
00173         static void setGraphicsSettings(LLControlGroup& group);
00174         static void createGroup();
00175 
00176         // if the quality radio buttons are changed
00177         static void onChangeQuality(LLUICtrl *ctrl, void *data);
00178         
00179         // if the custom settings box is clicked
00180         static void onChangeCustom(LLUICtrl *ctrl, void *data);
00181         
00182         static void onOpenHelp(void *data);
00183         static void onOpenHardwareSettings(void *data);
00184         static void onCommitAutoDetectAspect(LLUICtrl *ctrl, void *data);
00185         static void onKeystrokeAspectRatio(LLLineEditor* caller, void* user_data);
00186         static void onSelectAspectRatio(LLUICtrl*, void*);
00187         static void onCommitWindowedMode(LLUICtrl* ctrl, void *data);
00188         static void onApplyResolution(LLUICtrl* ctrl, void* data);
00189         static void updateSliderText(LLUICtrl* ctrl, void* user_data);
00190         static void updateMeterText(LLUICtrl* ctrl, void* user_data);
00191 
00193         static void setHardwareDefaults(void *data);
00194 
00195         // callback for when client turns on shaders
00196         static void onVertexShaderEnable(LLUICtrl*, void*);
00197 
00198         // helper function
00199         static void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator);
00200 };
00201 
00202 const S32 LL_MAX_VRAM_INDEX = 6;
00203 
00204 #endif

Generated on Fri May 16 08:33:50 2008 for SecondLife by  doxygen 1.5.5