Use configured resolution for login/outgame/ingame
[ryzomcore.git] / ryzom / tools / client / client_config / display_dlg.h
blob2f80d194ebb536fe7d62d450794bcca55d1cb08c
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #if !defined(AFX_DISPLAY_DLG_H__1287701D_07D1_48F0_8F13_3FCE937DA3A2__INCLUDED_)
18 #define AFX_DISPLAY_DLG_H__1287701D_07D1_48F0_8F13_3FCE937DA3A2__INCLUDED_
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif // _MSC_VER > 1000
23 // display_dlg.h : header file
26 #include "base_dialog.h"
27 #include "resource.h"
29 // ***************************************************************************
30 // CDisplayDlg dialog
31 // ***************************************************************************
33 class CDisplayDlg : public CBaseDialog
35 // Construction
36 public:
37 CDisplayDlg(CWnd* pParent = NULL); // standard constructor
38 enum TDriverChoiceMode { DrvChooseAuto = 0, DrvChooseOpenGL, DrvChooseDirect3D, DrvChooseUnknwown = -1 };
39 enum TDriver { OpenGL = 0, Direct3D };
40 // Dialog Data
41 //{{AFX_DATA(CDisplayDlg)
42 enum { IDD = IDD_DISPLAY };
43 CStatic TextFS0;
44 CStatic TextWnd0;
45 CStatic TextWnd1;
46 CStatic TextWnd2;
47 CStatic TextWnd3;
48 CEdit PositionYCtrl;
49 CEdit PositionXCtrl;
50 CEdit HeightCtrl;
51 CEdit WidthCtrl;
52 CComboBox ModeCtrl;
53 int DriverChoiceMode; // one of the TDriverChoiceMode values
54 int Windowed;
55 UINT Width;
56 UINT Height;
57 int Mode;
58 int PositionX;
59 int PositionY;
60 //}}AFX_DATA
62 // Update data
63 void updateState ();
65 /** Get the selected driver (if Driver is in mode Auto, choose the best driver depending on the hardware)
66 * \return 0 for D3D & 1 for OpenGL
68 TDriver getActualDriver() const;
70 // Overrides
71 // ClassWizard generated virtual function overrides
72 //{{AFX_VIRTUAL(CDisplayDlg)
73 protected:
74 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
75 //}}AFX_VIRTUAL
77 // Implementation
78 protected:
80 // Generated message map functions
81 //{{AFX_MSG(CDisplayDlg)
82 afx_msg void OnFullscreen();
83 afx_msg void OnWindow();
84 virtual BOOL OnInitDialog();
85 afx_msg void OnDirect3d();
86 afx_msg void OnDrv3DAuto();
87 afx_msg void OnChangeHeight();
88 afx_msg void OnOpengl();
89 afx_msg void OnChangePositionX();
90 afx_msg void OnChangeWidth();
91 afx_msg void OnChangePositionY();
92 afx_msg void OnColorDepth32();
93 afx_msg void OnSelchangeMode();
94 //}}AFX_MSG
95 DECLARE_MESSAGE_MAP()
98 // ***************************************************************************
100 class CVideoMode
102 public:
103 uint Width;
104 uint Height;
105 uint ColorDepth; // 32 only
106 uint Frequency;
108 // Operator
109 bool operator== (const CVideoMode &other) const
111 return (Width == other.Width) && (Height == other.Height) && (ColorDepth == other.ColorDepth) && (Frequency == other.Frequency);
113 bool operator< (const CVideoMode &other) const
115 if (Width < other.Width) return true;
116 else if (Width > other.Width) return false;
117 else if (Height < other.Height) return true;
118 else if (Height > other.Height) return false;
119 else if (ColorDepth < other.ColorDepth) return true;
120 else if (ColorDepth > other.ColorDepth) return false;
121 else if (Frequency < other.Frequency) return true;
122 else return false;
126 // ***************************************************************************
128 enum
130 ModeOpenGL = 0,
131 ModeDirectX
134 // ***************************************************************************
136 extern std::vector<CVideoMode> VideoModes[2];
137 extern std::vector<std::string> GLExtensions;
138 extern std::string GLRenderer;
139 extern std::string GLVendor;
140 extern std::string GLVersion;
141 extern std::string D3DDescription;
142 extern std::string D3DDeviceName;
143 extern std::string D3DDriver;
144 extern std::string D3DDriverVersion;
145 extern std::string D3DVendor;
146 extern uint VideoMemory;
147 extern uint HardwareSoundBuffer;
148 extern uint64 SystemMemory;
149 extern uint CPUFrequency;
151 // ***************************************************************************
153 // Register video modes
154 void RegisterVideoModes (uint mode, NL3D::IDriver *driver);
156 // Get opengl information
157 bool GetSystemInformation (NL3D::IDriver *d3dDriver);
159 // ***************************************************************************
161 //{{AFX_INSERT_LOCATION}}
162 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
164 #endif // !defined(AFX_DISPLAY_DLG_H__1287701D_07D1_48F0_8F13_3FCE937DA3A2__INCLUDED_)