Nebula
Loading...
Searching...
No Matches
Base::DisplayDeviceBase Class Reference

#include <displaydevicebase.h>

Detailed Description

A DisplayDevice object represents the display where the RenderDevice presents the rendered frame.

Use the display device object to get information about available adapters and display modes, and to set the preferred display mode of a Nebula application.

Inherits Core::RefCounted.

Inherited by GLFW::GLFWDisplayDevice, and Win32::Win32DisplayDevice.

Public Member Functions

 DisplayDeviceBase ()
 constructor
 
virtual ~DisplayDeviceBase ()
 destructor
 
bool Open ()
 open the display
 
void Close ()
 close the display
 
bool IsOpen () const
 return true if display is currently open
 
void ProcessWindowMessages ()
 process window system messages, call this method once per frame
 
void Reopen ()
 reopens the display device which enables switching from display modes
 
void SetVerticalSyncEnabled (bool b)
 set if vertical sync should be used
 
const bool IsVerticalSyncEnabled () const
 get if vertical sync is enabled
 
bool AdapterExists (CoreGraphics::Adapter::Code adapter)
 return true if adapter exists
 
Util::Array< CoreGraphics::DisplayModeGetAvailableDisplayModes (CoreGraphics::Adapter::Code adapter, CoreGraphics::PixelFormat::Code pixelFormat)
 get available display modes on given adapter
 
bool SupportsDisplayMode (CoreGraphics::Adapter::Code adapter, const CoreGraphics::DisplayMode &requestedMode)
 return true if a given display mode is supported
 
CoreGraphics::DisplayMode GetCurrentAdapterDisplayMode (CoreGraphics::Adapter::Code adapter)
 get current adapter display mode (i.e. the desktop display mode)
 
CoreGraphics::AdapterInfo GetAdapterInfo (CoreGraphics::Adapter::Code adapter)
 get general info about display adapter
 
void SetAdapter (CoreGraphics::Adapter::Code a)
 set display adapter (make sure adapter exists!)
 
CoreGraphics::Adapter::Code GetAdapter () const
 get display adapter
 
const bool IsFullscreen () const
 get if a window is running in full screen
 
void AttachEventHandler (const Ptr< CoreGraphics::DisplayEventHandler > &h)
 attach a display event handler
 
void RemoveEventHandler (const Ptr< CoreGraphics::DisplayEventHandler > &h)
 remove a display event handler
 
CoreGraphics::WindowId SetupWindow (const Util::String &title, const Util::String &icon, const CoreGraphics::DisplayMode &displayMode, const CoreGraphics::AntiAliasQuality::Code aa=CoreGraphics::AntiAliasQuality::None)
 create a new window
 
CoreGraphics::WindowId EmbedWindow (const Util::Blob &windowData)
 create a window from one created by another window system
 
CoreGraphics::WindowId GetMainWindow () const
 get the 'main' window, if none exists, returns NULL
 
const CoreGraphics::WindowId GetCurrentWindow () const
 get the current window
 
const CoreGraphics::WindowId GetWindow (IndexT index) const
 get window using index, where 0 is the default window
 
const Util::Array< CoreGraphics::WindowId > & GetWindows () const
 get all windows as an array
 
void MakeWindowCurrent (const CoreGraphics::WindowId id)
 make ID the current one
 
- Public Member Functions inherited from Core::RefCounted
 RefCounted ()
 constructor
 
int GetRefCount () const
 get the current refcount
 
void AddRef ()
 increment refcount by one
 
void Release ()
 decrement refcount and destroy object if refcount is zero
 
bool IsInstanceOf (const Rtti &rtti) const
 return true if this object is instance of given class
 
bool IsInstanceOf (const Util::String &className) const
 return true if this object is instance of given class by string
 
bool IsInstanceOf (const Util::FourCC &classFourCC) const
 return true if this object is instance of given class by fourcc
 
bool IsA (const Rtti &rtti) const
 return true if this object is instance of given class, or a derived class
 
bool IsA (const Util::String &rttiName) const
 return true if this object is instance of given class, or a derived class, by string
 
bool IsA (const Util::FourCC &rttiFourCC) const
 return true if this object is instance of given class, or a derived class, by fourcc
 
const Util::StringGetClassName () const
 get the class name
 
Util::FourCC GetClassFourCC () const
 get the class FourCC code
 

Protected Member Functions

bool NotifyEventHandlers (const CoreGraphics::DisplayEvent &e)
 notify event handlers about an event
 
- Protected Member Functions inherited from Core::RefCounted
virtual ~RefCounted ()
 destructor (called when refcount reaches zero)
 

Protected Attributes

CoreGraphics::Adapter::Code adapter
 
bool verticalSync
 
bool isOpen
 
bool isFullscreen
 
Util::Array< Ptr< CoreGraphics::DisplayEventHandler > > eventHandlers
 
CoreGraphics::WindowId currentWindow
 
Util::Array< CoreGraphics::WindowIdwindows
 

Private Member Functions

 __DeclareClass (DisplayDeviceBase)
 
 __DeclareSingleton (DisplayDeviceBase)
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)
 

Constructor & Destructor Documentation

◆ DisplayDeviceBase()

Base::DisplayDeviceBase::DisplayDeviceBase ( )

constructor

◆ ~DisplayDeviceBase()

Base::DisplayDeviceBase::~DisplayDeviceBase ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

Base::DisplayDeviceBase::__DeclareClass ( DisplayDeviceBase )
private

◆ __DeclareSingleton()

Base::DisplayDeviceBase::__DeclareSingleton ( DisplayDeviceBase )
private

◆ AdapterExists()

bool Base::DisplayDeviceBase::AdapterExists ( CoreGraphics::Adapter::Code adapter)

return true if adapter exists

Checks if the given adapter exists.

◆ AttachEventHandler()

void Base::DisplayDeviceBase::AttachEventHandler ( const Ptr< CoreGraphics::DisplayEventHandler > & h)

attach a display event handler

Attach an event handler to the display device.

◆ Close()

void Base::DisplayDeviceBase::Close ( )

close the display

Close the display.

◆ EmbedWindow()

CoreGraphics::WindowId Base::DisplayDeviceBase::EmbedWindow ( const Util::Blob & windowData)

create a window from one created by another window system

◆ GetAdapter()

CoreGraphics::Adapter::Code Base::DisplayDeviceBase::GetAdapter ( ) const
inline

get display adapter

◆ GetAdapterInfo()

AdapterInfo Base::DisplayDeviceBase::GetAdapterInfo ( CoreGraphics::Adapter::Code adapter)

get general info about display adapter

Returns information about the provided adapter.

◆ GetAvailableDisplayModes()

Util::Array< DisplayMode > Base::DisplayDeviceBase::GetAvailableDisplayModes ( CoreGraphics::Adapter::Code adapter,
CoreGraphics::PixelFormat::Code pixelFormat )

get available display modes on given adapter

Returns the display modes on the given adapter in the given pixel format.

◆ GetCurrentAdapterDisplayMode()

DisplayMode Base::DisplayDeviceBase::GetCurrentAdapterDisplayMode ( CoreGraphics::Adapter::Code adapter)

get current adapter display mode (i.e. the desktop display mode)

This method returns the current adapter display mode.

It can be used to get the current desktop display mode.

◆ GetCurrentWindow()

const CoreGraphics::WindowId Base::DisplayDeviceBase::GetCurrentWindow ( ) const
inline

get the current window

◆ GetMainWindow()

CoreGraphics::WindowId Base::DisplayDeviceBase::GetMainWindow ( ) const
inline

get the 'main' window, if none exists, returns NULL

◆ GetWindow()

const CoreGraphics::WindowId Base::DisplayDeviceBase::GetWindow ( IndexT index) const
inline

get window using index, where 0 is the default window

◆ GetWindows()

const Util::Array< CoreGraphics::WindowId > & Base::DisplayDeviceBase::GetWindows ( ) const
inline

get all windows as an array

◆ IsFullscreen()

const bool Base::DisplayDeviceBase::IsFullscreen ( ) const
inline

get if a window is running in full screen

◆ IsOpen()

bool Base::DisplayDeviceBase::IsOpen ( ) const
inline

return true if display is currently open

◆ IsVerticalSyncEnabled()

const bool Base::DisplayDeviceBase::IsVerticalSyncEnabled ( ) const
inline

get if vertical sync is enabled

◆ MakeWindowCurrent()

void Base::DisplayDeviceBase::MakeWindowCurrent ( const CoreGraphics::WindowId id)

make ID the current one

◆ NotifyEventHandlers()

bool Base::DisplayDeviceBase::NotifyEventHandlers ( const CoreGraphics::DisplayEvent & e)
protected

notify event handlers about an event

Notify all event handlers about an event.

◆ Open()

bool Base::DisplayDeviceBase::Open ( )

open the display

Open the display.

◆ ProcessWindowMessages()

void Base::DisplayDeviceBase::ProcessWindowMessages ( )

process window system messages, call this method once per frame

Process window system messages.

Override this method in a subclass.

◆ RemoveEventHandler()

void Base::DisplayDeviceBase::RemoveEventHandler ( const Ptr< CoreGraphics::DisplayEventHandler > & h)

remove a display event handler

Remove an event handler from the display device.

◆ Reopen()

void Base::DisplayDeviceBase::Reopen ( )

reopens the display device which enables switching from display modes

◆ SetAdapter()

void Base::DisplayDeviceBase::SetAdapter ( CoreGraphics::Adapter::Code a)
inline

set display adapter (make sure adapter exists!)

◆ SetupWindow()

CoreGraphics::WindowId Base::DisplayDeviceBase::SetupWindow ( const Util::String & title,
const Util::String & icon,
const CoreGraphics::DisplayMode & displayMode,
const CoreGraphics::AntiAliasQuality::Code aa = CoreGraphics::AntiAliasQuality::None )

create a new window

◆ SetVerticalSyncEnabled()

void Base::DisplayDeviceBase::SetVerticalSyncEnabled ( bool b)
inline

set if vertical sync should be used

◆ SupportsDisplayMode()

bool Base::DisplayDeviceBase::SupportsDisplayMode ( CoreGraphics::Adapter::Code adapter,
const CoreGraphics::DisplayMode & requestedMode )

return true if a given display mode is supported

This method checks the available display modes on the given adapter against the requested display modes and returns true if the display mode exists.

Member Data Documentation

◆ adapter

CoreGraphics::Adapter::Code Base::DisplayDeviceBase::adapter
protected

◆ currentWindow

CoreGraphics::WindowId Base::DisplayDeviceBase::currentWindow
protected

◆ eventHandlers

Util::Array<Ptr<CoreGraphics::DisplayEventHandler> > Base::DisplayDeviceBase::eventHandlers
protected

◆ isFullscreen

bool Base::DisplayDeviceBase::isFullscreen
protected

◆ isOpen

bool Base::DisplayDeviceBase::isOpen
protected

◆ verticalSync

bool Base::DisplayDeviceBase::verticalSync
protected

◆ windows

Util::Array<CoreGraphics::WindowId> Base::DisplayDeviceBase::windows
protected

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