![]() |
PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
|
Definition at line 25 of file PureScreen.cpp.
Public Member Functions | |
virtual | ~PureScreenImpl () |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
TPureBool | applyDisplaySettings (HDC dc, TPURE_SCREEN_PF pixelFormat=PURE_SCREEN_PF_SIMPLE) |
Applies the set settings and the appropriate pixel format for the given HDC. | |
void | ResetDisplaySettings () |
Resets the original display settings. | |
TPureBool | isInitialized () const |
Gets whether display settings are applied. | |
TPureUInt | getResWidth () const |
Gets the horizontal display resolution. | |
TPureUInt | getResHeight () const |
Gets the vertical display resolution. | |
void | SetResolution (TPureUInt w, TPureUInt h) |
Stores the given display resolution. | |
TPureBool | isFullScreened () const |
Gets whether we wanted fullscreen or not. | |
void | SetFullScreened (TPureBool fs) |
Stores whether we want fullscreen mode or not. | |
TPureUInt | getFreq () const |
Gets the stored display refresh rate. | |
void | SetFreq (TPureUInt f) |
Stores the needed display refresh rate. | |
TPureInt | getColorBits () const |
Gets the stored display color depth. | |
void | SetColorBits (TPureInt c) |
Stores the needed display color depth. | |
TPureInt | getDepthBits () const |
Gets the needed Z-buffer depth. | |
void | SetDepthBits (TPureInt d) |
Stores the needed Z-Buffer depth. | |
TPureInt | getStencilBits () const |
Gets the stored Stencil Buffer depth. | |
void | SetStencilBits (TPureInt s) |
Stores the needed Stencil Buffer depth. | |
TPureBool | isScreensaverEnabled () const |
Gets whether the screensaver is allowed or not while the engine is running. | |
void | SetScreensaverEnabled (TPureBool state) |
Sets whether the screensaver is allowed or not while the engine is running. | |
TPureBool | isMonitorPowersaveEnabled () const |
Gets whether monitor power saving is allowed or not while the engine is running. | |
void | SetMonitorPowersaveEnabled (TPureBool state) |
Sets whether monitor power saving is allowed or not while the engine is running. | |
TPureBool | isStandbyEnabled () const |
Gets whether computer standy is allowed or not while the engine is running. | |
void | SetStandbyEnabled (TPureBool state) |
Sets whether computer standy is allowed or not while the engine is running. | |
TPureBool | isFSAAready () const |
Gets whether the engine is ready to use FSAA. | |
TPureInt | getFSAAlevel () const |
Gets the actual FSAA-level. | |
void | SetFSAAlevel (TPureInt level) |
Sets the needed FSAA-level. | |
TPureBool | isVSyncEnabled () const |
Gets whether VSync is enabled or not. | |
TPureBool | setVSyncEnabled (TPureBool state) |
Sets the state of VSync. | |
![]() |
Static Public Member Functions | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static PureScreen & | createAndGet () |
Creates and gets the singleton instance. | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
Private Member Functions | |
PureScreenImpl () | |
Fills up members with default values. | |
PureScreenImpl (const PureScreenImpl &) | |
PureScreenImpl & | operator= (const PureScreenImpl &) |
void | FindSimplePixelFormat (HDC dc) |
Finds a pixel format for the given HDC based on the previously set values like color bits. | |
void | FindAdvancedPixelFormat (HDC dc) |
Finds a pixel format for the given HDC based on the previously set values like color bits. | |
void | ReadAdvancedPixelFormatInfo (HDC dc, int iAppliedPixelFormat) |
Reads advanced pixel format about the given pixel format using wglGetPixelFormatAttrib...(). | |
TPureBool | applyPixelFormat (HDC dc, int iPixelFormat, PIXELFORMATDESCRIPTOR *pfd) |
Sets the given pixel format for the given HDC. | |
void | ReadCurrentDisplaySettings (TPureUInt &nWidth, TPureUInt &nHeight, TPureInt &nCDepth, TPureUInt &nRefRate) |
Reads and stores current display resolution width, height, color depth and refresh rate. | |
TPureUInt | findMaximumRefreshRate (TPureUInt nWidth, TPureUInt nHeight, TPureInt nCDepth) |
Finds the maximum available refresh rate for the given display resolution width, height and color depth. | |
bool | switchToFullscreenMode (TPureUInt nWidth, TPureUInt nHeight, TPureInt nCDepth, TPureUInt nRefRate) |
Switches display mode to fullscreen at the given resolution width, height, color depth with the given refresh rate. | |
Private Attributes | |
PureSharedSettings & | sharedSettings |
Pointer to shared settings. | |
PIXELFORMATDESCRIPTOR | m_pfd |
Pixelformat descriptor. | |
TPureBool | bDisplaySettingsApplied |
Are the set display settings applied? | |
TPureBool | bFullScreen |
Are we in fullscreen mode? | |
int | iSimplePixelFormat |
Best pixel format found by Win32. | |
int | m_iAdvancedPixelFormat |
Best pixel format found by OpenGL. | |
int | m_iAppliedPixelFormat |
Currently applied pixel format, iSimple or iAdvanced. | |
TPureUInt | nResX |
Horizontal screen resolution. | |
TPureUInt | nResY |
Vertical screen resolution. | |
TPureUInt | nRefreshRate |
Screen refresh rate. | |
TPureInt | nBitsColor |
Screen color depth. | |
TPureInt | nBitsDepth |
ZBuffer depth (32/24/16). | |
TPureInt | nBitsStencil |
Stencil buffer depth (8/0). | |
TPureBool | bFSAA_ready |
Is FSAA initialized? | |
GLint | iFSAA_state |
Current FSAA-level (0x/1x/2x/3x/...). | |
GLint | iFSAA_req |
Requested FSAA-level. | |
TPureBool | bVSyncState |
Is VSync enabled? | |
Friends | |
class | PureScreen |
Additional Inherited Members | |
![]() | |
static constexpr char * | CVAR_GFX_VSYNC = "gfx_vsync" |
|
virtual |
Definition at line 132 of file PureScreen.cpp.
|
private |
Fills up members with default values.
Definition at line 469 of file PureScreen.cpp.
|
private |
Definition at line 491 of file PureScreen.cpp.
|
virtual |
Applies the set settings and the appropriate pixel format for the given HDC.
The following functions must be called before this:
Requesting an FSAA mode is complex a little bit: first call this method with pixelFormat = simple, then after initializing OpenGL, call this method again so an advanced pixel format will be selected. Then shutdown OpenGL, and close the previously created window, create a new window and call this method with pixelFormat = advanced. This time an FSAA-ready pixel format will be set so you can reinitialize OpenGL and enable FSAA in it.
Implements PureScreen.
Definition at line 163 of file PureScreen.cpp.
|
private |
Sets the given pixel format for the given HDC.
Updates m_iAppliedPixelFormat.
Definition at line 669 of file PureScreen.cpp.
|
private |
Finds a pixel format for the given HDC based on the previously set values like color bits.
Advanced means the pfd will be selected by OpenGL so this method requires OpenGL to be initialized. This method can be used if an FSAA-ready pfd is needed. Updates m_iAdvancedPixelFormat.
Definition at line 553 of file PureScreen.cpp.
|
private |
Finds the maximum available refresh rate for the given display resolution width, height and color depth.
Definition at line 715 of file PureScreen.cpp.
|
private |
Finds a pixel format for the given HDC based on the previously set values like color bits.
This is the legacy way of selecting a pfd and this does not support setting up FSAA. Tries to lower Z-depth bits to 24 or 16 to ensure success. Updates iSimplePixelFormat.
Definition at line 508 of file PureScreen.cpp.
|
virtual |
Gets the stored display color depth.
Implements PureScreen.
Definition at line 332 of file PureScreen.cpp.
CConsole & PureScreenImpl::getConsole | ( | ) | const |
Returns access to console preset with logger module name as this class.
Intentionally not virtual, so the getConsole() in derived class should hide this instead of overriding.
Definition at line 144 of file PureScreen.cpp.
|
virtual |
Gets the needed Z-buffer depth.
Implements PureScreen.
Definition at line 346 of file PureScreen.cpp.
|
virtual |
Gets the stored display refresh rate.
Implements PureScreen.
Definition at line 318 of file PureScreen.cpp.
|
virtual |
Gets the actual FSAA-level.
Default value is 0.
Implements PureScreen.
Definition at line 412 of file PureScreen.cpp.
|
static |
Returns the logger module name of this class.
Intentionally not virtual, so derived class should hide this instead of overriding. Not even private, so user can also access this from outside, for any reason like controlling log filtering per logger module name.
Definition at line 157 of file PureScreen.cpp.
|
virtual |
Gets the vertical display resolution.
Should be used only after a successful applyDisplaySettings().
Implements PureScreen.
Definition at line 270 of file PureScreen.cpp.
|
virtual |
Gets the horizontal display resolution.
Should be used only after a successful applyDisplaySettings().
Implements PureScreen.
Definition at line 265 of file PureScreen.cpp.
|
virtual |
Gets the stored Stencil Buffer depth.
Implements PureScreen.
Definition at line 360 of file PureScreen.cpp.
|
virtual |
Gets whether the engine is ready to use FSAA.
Implements PureScreen.
Definition at line 407 of file PureScreen.cpp.
|
virtual |
Gets whether we wanted fullscreen or not.
Implements PureScreen.
Definition at line 305 of file PureScreen.cpp.
|
virtual |
Gets whether display settings are applied.
Implements PureScreen.
Definition at line 259 of file PureScreen.cpp.
|
virtual |
Gets whether monitor power saving is allowed or not while the engine is running.
Enabled by default.
Implements PureScreen.
Definition at line 385 of file PureScreen.cpp.
|
virtual |
Gets whether the screensaver is allowed or not while the engine is running.
Disabled by default.
Implements PureScreen.
Definition at line 374 of file PureScreen.cpp.
|
virtual |
Gets whether computer standy is allowed or not while the engine is running.
Disabled by default.
Implements PureScreen.
Definition at line 396 of file PureScreen.cpp.
|
virtual |
Gets whether VSync is enabled or not.
Disabled by default.
Implements PureScreen.
Definition at line 426 of file PureScreen.cpp.
|
private |
Definition at line 496 of file PureScreen.cpp.
|
private |
Reads advanced pixel format about the given pixel format using wglGetPixelFormatAttrib...().
Definition at line 600 of file PureScreen.cpp.
|
private |
Reads and stores current display resolution width, height, color depth and refresh rate.
Definition at line 695 of file PureScreen.cpp.
|
virtual |
Resets the original display settings.
If no settings have been applied yet or not in fullscreen mode, the function has no effect.
Implements PureScreen.
Definition at line 231 of file PureScreen.cpp.
|
virtual |
Stores the needed display color depth.
Can be used only before applyDisplaySettings(), no effect otherwise. A call to applyDisplaySettings() is needed to apply the setting.
Implements PureScreen.
Definition at line 337 of file PureScreen.cpp.
|
virtual |
Stores the needed Z-Buffer depth.
Can be used only before applyDisplaySettings(), no effect otherwise. A call to applyDisplaySettings() is needed to apply the setting.
Implements PureScreen.
Definition at line 351 of file PureScreen.cpp.
|
virtual |
Stores the needed display refresh rate.
Can be used only before applyDisplaySettings(), no effect otherwise. The stored display refresh rate will be applied only in fullscreen mode by a successful applyDisplaySettings().
Implements PureScreen.
Definition at line 323 of file PureScreen.cpp.
|
virtual |
Sets the needed FSAA-level.
Default value is 0. Can be used only before applyDisplaySettings(), no effect otherwise. A call to applyDisplaySettings() is needed to apply the setting.
Implements PureScreen.
Definition at line 417 of file PureScreen.cpp.
|
virtual |
Stores whether we want fullscreen mode or not.
Can be used only before applyDisplaySettings(), no effect otherwise. A call to applyDisplaySettings() is needed to apply the setting.
Implements PureScreen.
Definition at line 310 of file PureScreen.cpp.
|
virtual |
Sets whether monitor power saving is allowed or not while the engine is running.
Enabled by default.
Implements PureScreen.
Definition at line 390 of file PureScreen.cpp.
Stores the given display resolution.
Can be used only before applyDisplaySettings(), no effect otherwise. If w or h is 0, the target width and height will be the current screen resolution. If the current screen resolution can't be queried, the target will be 800x600. A call to applyDisplaySettings() is needed to apply the stored display resolution.
Implements PureScreen.
Definition at line 276 of file PureScreen.cpp.
|
virtual |
Sets whether the screensaver is allowed or not while the engine is running.
Disabled by default.
Implements PureScreen.
Definition at line 379 of file PureScreen.cpp.
|
virtual |
Sets whether computer standy is allowed or not while the engine is running.
Disabled by default.
Implements PureScreen.
Definition at line 401 of file PureScreen.cpp.
|
virtual |
Stores the needed Stencil Buffer depth.
Can be used only before applyDisplaySettings(), no effect otherwise. A call to applyDisplaySettings() is needed to apply the setting.
Implements PureScreen.
Definition at line 365 of file PureScreen.cpp.
Sets the state of VSync.
Default state is false. No effect if VSync is not supported.
Implements PureScreen.
Definition at line 431 of file PureScreen.cpp.
|
private |
Switches display mode to fullscreen at the given resolution width, height, color depth with the given refresh rate.
Definition at line 738 of file PureScreen.cpp.
|
friend |
Definition at line 123 of file PureScreen.cpp.
|
private |
Are the set display settings applied?
Definition at line 86 of file PureScreen.cpp.
|
private |
Is FSAA initialized?
Definition at line 97 of file PureScreen.cpp.
|
private |
Are we in fullscreen mode?
Definition at line 87 of file PureScreen.cpp.
|
private |
Is VSync enabled?
Definition at line 100 of file PureScreen.cpp.
|
private |
Requested FSAA-level.
Definition at line 99 of file PureScreen.cpp.
|
private |
Current FSAA-level (0x/1x/2x/3x/...).
Definition at line 98 of file PureScreen.cpp.
|
private |
Best pixel format found by Win32.
Definition at line 88 of file PureScreen.cpp.
|
private |
Best pixel format found by OpenGL.
Definition at line 89 of file PureScreen.cpp.
|
private |
Currently applied pixel format, iSimple or iAdvanced.
Definition at line 90 of file PureScreen.cpp.
|
private |
Pixelformat descriptor.
Definition at line 85 of file PureScreen.cpp.
|
private |
Screen color depth.
Definition at line 94 of file PureScreen.cpp.
|
private |
ZBuffer depth (32/24/16).
Definition at line 95 of file PureScreen.cpp.
|
private |
Stencil buffer depth (8/0).
Definition at line 96 of file PureScreen.cpp.
|
private |
Screen refresh rate.
Definition at line 93 of file PureScreen.cpp.
|
private |
Horizontal screen resolution.
Definition at line 91 of file PureScreen.cpp.
|
private |
Vertical screen resolution.
Definition at line 92 of file PureScreen.cpp.
|
private |
Pointer to shared settings.
Definition at line 83 of file PureScreen.cpp.