PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PureScreen Class Referenceabstract

Screen handler class. More...

Detailed Description

Screen handler class.

Screen resolution, FSAA, etc ...

Definition at line 36 of file PureScreen.h.

#include <PureScreen.h>

+ Inheritance diagram for PureScreen:

Public Member Functions

virtual TPureBool applyDisplaySettings (HDC dc, TPURE_SCREEN_PF pixelFormat=PURE_SCREEN_PF_SIMPLE)=0
 Applies the set settings and the appropriate pixel format for the given HDC.
 
virtual void ResetDisplaySettings ()=0
 Resets the original display settings.
 
virtual TPureBool isInitialized () const =0
 Gets whether display settings are applied.
 
virtual TPureUInt getResWidth () const =0
 Gets the horizontal display resolution.
 
virtual TPureUInt getResHeight () const =0
 Gets the vertical display resolution.
 
virtual void SetResolution (TPureUInt w, TPureUInt h)=0
 Stores the given display resolution.
 
virtual TPureBool isFullScreened () const =0
 Gets whether we wanted fullscreen or not.
 
virtual void SetFullScreened (TPureBool fs)=0
 Stores whether we want fullscreen mode or not.
 
virtual TPureUInt getFreq () const =0
 Gets the stored display refresh rate.
 
virtual void SetFreq (TPureUInt f)=0
 Stores the needed display refresh rate.
 
virtual TPureInt getColorBits () const =0
 Gets the stored display color depth.
 
virtual void SetColorBits (TPureInt c)=0
 Stores the needed display color depth.
 
virtual TPureInt getDepthBits () const =0
 Gets the needed Z-buffer depth.
 
virtual void SetDepthBits (TPureInt d)=0
 Stores the needed Z-Buffer depth.
 
virtual TPureInt getStencilBits () const =0
 Gets the stored Stencil Buffer depth.
 
virtual void SetStencilBits (TPureInt s)=0
 Stores the needed Stencil Buffer depth.
 
virtual TPureBool isScreensaverEnabled () const =0
 Gets whether the screensaver is allowed or not while the engine is running.
 
virtual void SetScreensaverEnabled (TPureBool state)=0
 Sets whether the screensaver is allowed or not while the engine is running.
 
virtual TPureBool isMonitorPowersaveEnabled () const =0
 Gets whether monitor power saving is allowed or not while the engine is running.
 
virtual void SetMonitorPowersaveEnabled (TPureBool state)=0
 Sets whether monitor power saving is allowed or not while the engine is running.
 
virtual TPureBool isStandbyEnabled () const =0
 Gets whether computer standy is allowed or not while the engine is running.
 
virtual void SetStandbyEnabled (TPureBool state)=0
 Sets whether computer standy is allowed or not while the engine is running.
 
virtual TPureBool isFSAAready () const =0
 Gets whether the engine is ready to use FSAA.
 
virtual TPureInt getFSAAlevel () const =0
 Gets the actual FSAA-level.
 
virtual void SetFSAAlevel (TPureInt level)=0
 Sets the needed FSAA-level.
 
virtual TPureBool isVSyncEnabled () const =0
 Gets whether VSync is enabled or not.
 
virtual TPureBool setVSyncEnabled (TPureBool state)=0
 Sets the state of VSync.
 

Static Public Member Functions

static PureScreencreateAndGet ()
 Creates and gets the singleton instance.
 
static const char * getLoggerModuleName ()
 Returns the logger module name of this class.
 

Static Public Attributes

static constexpr char * CVAR_GFX_VSYNC = "gfx_vsync"
 

Member Function Documentation

◆ applyDisplaySettings()

virtual TPureBool PureScreen::applyDisplaySettings ( HDC dc,
TPURE_SCREEN_PF pixelFormat = PURE_SCREEN_PF_SIMPLE )
pure virtual

Applies the set settings and the appropriate pixel format for the given HDC.

The following functions must be called before this:

  • SetResolution()
  • SetColorBits()
  • SetDepthBits() The result of not calling any of the mentioned functions is the function has no effect. Changes screen resolution, color depth and refresh rate ONLY IF fullscreen mode is requested. If fullscreen mode is requested without calling SetFreq() with an available value, like 60, the greatest available refresh rate will be applied.

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.

Returns
True if succeeds, false on error.

Implemented in PureScreenImpl.

◆ createAndGet()

PureScreen & PureScreen::createAndGet ( )
static

Creates and gets the singleton instance.

Definition at line 765 of file PureScreen.cpp.

◆ getColorBits()

virtual TPureInt PureScreen::getColorBits ( ) const
pure virtual

Gets the stored display color depth.

Returns
0 before a call to applyDisplaySettings() or SetColorBits(). The stored value after SetColorBits() and before applyDisplaySettings(). The finally selected value after a successful applyDisplaySettings().

Implemented in PureScreenImpl.

◆ getDepthBits()

virtual TPureInt PureScreen::getDepthBits ( ) const
pure virtual

Gets the needed Z-buffer depth.

Returns
0 before a call to applyDisplaySettings() or SetDepthBits(). The stored value after SetColorBits() and before applyDisplaySettings(). The finally selected value after a successful applyDisplaySettings(). This value maybe lower than the needed value because the engine automatically tries to apply a lower value if the needed value is not supported by the driver.

Implemented in PureScreenImpl.

◆ getFreq()

virtual TPureUInt PureScreen::getFreq ( ) const
pure virtual

Gets the stored display refresh rate.

Returns
0 or the stored value, if called before a successful applyDisplaySettings(), otherwise the finally selected refreshrate after a successful applyDisplaySettings().

Implemented in PureScreenImpl.

◆ getFSAAlevel()

virtual TPureInt PureScreen::getFSAAlevel ( ) const
pure virtual

Gets the actual FSAA-level.

Default value is 0.

Returns
The actual FSAA-value, 0 means no FSAA.

Implemented in PureScreenImpl.

◆ getLoggerModuleName()

const char * PureScreen::getLoggerModuleName ( )
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.

Returns
The logger module name of this class.

Definition at line 779 of file PureScreen.cpp.

◆ getResHeight()

virtual TPureUInt PureScreen::getResHeight ( ) const
pure virtual

Gets the vertical display resolution.

Should be used only after a successful applyDisplaySettings().

Returns
The vertical display resolution in pixels.

Implemented in PureScreenImpl.

◆ getResWidth()

virtual TPureUInt PureScreen::getResWidth ( ) const
pure virtual

Gets the horizontal display resolution.

Should be used only after a successful applyDisplaySettings().

Returns
The horizontal display resolution in pixels.

Implemented in PureScreenImpl.

◆ getStencilBits()

virtual TPureInt PureScreen::getStencilBits ( ) const
pure virtual

Gets the stored Stencil Buffer depth.

Returns
0 before a call to applyDisplaySettings() or SetStencilBits(). The stored value after SetStencilBits() and before applyDisplaySettings(). The finally selected value after a successful applyDisplaySettings().

Implemented in PureScreenImpl.

◆ isFSAAready()

virtual TPureBool PureScreen::isFSAAready ( ) const
pure virtual

Gets whether the engine is ready to use FSAA.

Returns
True if FSAA can be used, false otherwise.

Implemented in PureScreenImpl.

◆ isFullScreened()

virtual TPureBool PureScreen::isFullScreened ( ) const
pure virtual

Gets whether we wanted fullscreen or not.

Returns
True, if we wanted fullscreen mode, otherwise false.

Implemented in PureScreenImpl.

◆ isInitialized()

virtual TPureBool PureScreen::isInitialized ( ) const
pure virtual

Gets whether display settings are applied.

Implemented in PureScreenImpl.

◆ isMonitorPowersaveEnabled()

virtual TPureBool PureScreen::isMonitorPowersaveEnabled ( ) const
pure virtual

Gets whether monitor power saving is allowed or not while the engine is running.

Enabled by default.

Returns
True if monitor power saving is allowed, false otherwise.

Implemented in PureScreenImpl.

◆ isScreensaverEnabled()

virtual TPureBool PureScreen::isScreensaverEnabled ( ) const
pure virtual

Gets whether the screensaver is allowed or not while the engine is running.

Disabled by default.

Returns
True if screensaver is allowed, false otherwise.

Implemented in PureScreenImpl.

◆ isStandbyEnabled()

virtual TPureBool PureScreen::isStandbyEnabled ( ) const
pure virtual

Gets whether computer standy is allowed or not while the engine is running.

Disabled by default.

Returns
True if computer standy is allowed, false otherwise.

Implemented in PureScreenImpl.

◆ isVSyncEnabled()

virtual TPureBool PureScreen::isVSyncEnabled ( ) const
pure virtual

Gets whether VSync is enabled or not.

Disabled by default.

Returns
True if VSync is currently enabled, otherwise false.

Implemented in PureScreenImpl.

◆ ResetDisplaySettings()

virtual void PureScreen::ResetDisplaySettings ( )
pure virtual

Resets the original display settings.

If no settings have been applied yet or not in fullscreen mode, the function has no effect.

Implemented in PureScreenImpl.

◆ SetColorBits()

virtual void PureScreen::SetColorBits ( TPureInt c)
pure 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.

Implemented in PureScreenImpl.

◆ SetDepthBits()

virtual void PureScreen::SetDepthBits ( TPureInt d)
pure 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.

Implemented in PureScreenImpl.

◆ SetFreq()

virtual void PureScreen::SetFreq ( TPureUInt f)
pure 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().

Implemented in PureScreenImpl.

◆ SetFSAAlevel()

virtual void PureScreen::SetFSAAlevel ( TPureInt level)
pure 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.

Implemented in PureScreenImpl.

◆ SetFullScreened()

virtual void PureScreen::SetFullScreened ( TPureBool fs)
pure 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.

Implemented in PureScreenImpl.

◆ SetMonitorPowersaveEnabled()

virtual void PureScreen::SetMonitorPowersaveEnabled ( TPureBool state)
pure virtual

Sets whether monitor power saving is allowed or not while the engine is running.

Enabled by default.

Implemented in PureScreenImpl.

◆ SetResolution()

virtual void PureScreen::SetResolution ( TPureUInt w,
TPureUInt h )
pure virtual

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.

Implemented in PureScreenImpl.

◆ SetScreensaverEnabled()

virtual void PureScreen::SetScreensaverEnabled ( TPureBool state)
pure virtual

Sets whether the screensaver is allowed or not while the engine is running.

Disabled by default.

Implemented in PureScreenImpl.

◆ SetStandbyEnabled()

virtual void PureScreen::SetStandbyEnabled ( TPureBool state)
pure virtual

Sets whether computer standy is allowed or not while the engine is running.

Disabled by default.

Implemented in PureScreenImpl.

◆ SetStencilBits()

virtual void PureScreen::SetStencilBits ( TPureInt s)
pure 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.

Implemented in PureScreenImpl.

◆ setVSyncEnabled()

virtual TPureBool PureScreen::setVSyncEnabled ( TPureBool state)
pure virtual

Sets the state of VSync.

Default state is false. No effect if VSync is not supported.

Returns
The new state. This implies that if requested enabled but a failure happened, false is returned.

Implemented in PureScreenImpl.

Member Data Documentation

◆ CVAR_GFX_VSYNC

char* PureScreen::CVAR_GFX_VSYNC = "gfx_vsync"
staticconstexpr

Definition at line 44 of file PureScreen.h.


The documentation for this class was generated from the following files: