Nebula
Loading...
Searching...
No Matches
GLFW::GLFWDisplayDevice Class Reference

#include <glfwdisplaydevice.h>

Inherits Base::DisplayDeviceBase.

Inherited by Vulkan::VkDisplayDevice.

Public Member Functions

 GLFWDisplayDevice ()
 constructor
virtual ~GLFWDisplayDevice ()
 destructor
bool Open ()
 open the display
void Close ()
 close the display
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
Util::FixedArray< CoreGraphics::MonitorGetMonitors ()
 Get list of monitors.
Public Member Functions inherited from Base::DisplayDeviceBase
 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
Util::FixedArray< CoreGraphics::MonitorGetMonitors ()
 Get list of monitors.
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
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
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

Static Public Member Functions

static void ProcessWindowMessages ()
 process window system messages, call this method once per frame
static Input::Key::Code TranslateKeyCode (int inkey)
 translate glfw keycodes to nebula ones
Static Public Member Functions inherited from Core::RefCounted
static void DumpRefCountingLeaks ()
 dump refcounting leaks, call at end of application (NEBULA_DEBUG builds only!)

Protected Member Functions

GLFWmonitor * GetMonitor (int index)
 retrieve monitor from adapter. can be NULL
Protected Member Functions inherited from Base::DisplayDeviceBase
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

Ptr< Input::InputDisplayEventHandlerinputEventHandler
Ptr< Graphics::GraphicsDisplayEventHandlergraphicsEventHandler
Protected Attributes inherited from Base::DisplayDeviceBase
CoreGraphics::Adapter::Code adapter
bool verticalSync
bool isOpen
bool isFullscreen
Util::Array< Ptr< CoreGraphics::DisplayEventHandler > > eventHandlers
Util::Array< CoreGraphics::WindowIdwindows

Private Member Functions

 __DeclareClass (GLFWDisplayDevice)
 __DeclareSingleton (GLFWDisplayDevice)

Friends

class GLFWWindow
class OGL4RenderDevice
class GLFWInputServer
void CoreGraphics::DestroyWindow (const CoreGraphics::WindowId id)
void KeyFunc (const CoreGraphics::WindowId &id, int key, int scancode, int action, int mods)
 Keyboard callback.
void CharFunc (const CoreGraphics::WindowId &id, unsigned int key)
 Character callback.
void MouseButtonFunc (const CoreGraphics::WindowId &id, int button, int action, int mods)
 Mouse Button callback.
void MouseFunc (const CoreGraphics::WindowId &id, double xpos, double ypos)
 Mouse callback.
void ScrollFunc (const CoreGraphics::WindowId &id, double xs, double ys)
 Scroll callback.
void CloseFunc (const CoreGraphics::WindowId &id)
 window close func
void FocusFunc (const CoreGraphics::WindowId &id, int focus)
 window focus
void ResizeFunc (const CoreGraphics::WindowId &id, int width, int height)
 window resize
void MoveFunc (const CoreGraphics::WindowId &id, int x, int y)
 Window move.
void CoreGraphics::WindowNewFrame (const CoreGraphics::WindowId id)
const CoreGraphics::WindowId InternalSetupFunction (const CoreGraphics::WindowCreateInfo &info)
 internal setup function, either does embedding or ordinary opening

Constructor & Destructor Documentation

◆ GLFWDisplayDevice()

GLFW::GLFWDisplayDevice::GLFWDisplayDevice ( )

constructor

◆ ~GLFWDisplayDevice()

GLFW::GLFWDisplayDevice::~GLFWDisplayDevice ( )
virtual

destructor

Member Function Documentation

◆ __DeclareClass()

GLFW::GLFWDisplayDevice::__DeclareClass ( GLFWDisplayDevice )
private

◆ __DeclareSingleton()

GLFW::GLFWDisplayDevice::__DeclareSingleton ( GLFWDisplayDevice )
private

◆ AdapterExists()

bool GLFW::GLFWDisplayDevice::AdapterExists ( CoreGraphics::Adapter::Code adapter)

return true if adapter exists

Checks if the given adapter exists.

◆ Close()

void GLFW::GLFWDisplayDevice::Close ( )

close the display

Close the display.

◆ GetAdapterInfo()

AdapterInfo GLFW::GLFWDisplayDevice::GetAdapterInfo ( CoreGraphics::Adapter::Code adapter)

get general info about display adapter

Returns information about the provided adapter.

◆ GetAvailableDisplayModes()

Util::Array< DisplayMode > GLFW::GLFWDisplayDevice::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 GLFW::GLFWDisplayDevice::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.

◆ GetMonitor()

GLFWmonitor * GLFW::GLFWDisplayDevice::GetMonitor ( int index)
protected

retrieve monitor from adapter. can be NULL

◆ GetMonitors()

Util::FixedArray< CoreGraphics::Monitor > GLFW::GLFWDisplayDevice::GetMonitors ( )

Get list of monitors.

◆ Open()

bool GLFW::GLFWDisplayDevice::Open ( )

open the display

Open the display.

◆ ProcessWindowMessages()

void GLFW::GLFWDisplayDevice::ProcessWindowMessages ( )
static

process window system messages, call this method once per frame

Process window system messages.

Override this method in a subclass.

◆ SupportsDisplayMode()

bool GLFW::GLFWDisplayDevice::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.

◆ TranslateKeyCode()

Input::Key::Code GLFW::GLFWDisplayDevice::TranslateKeyCode ( int inkey)
static

translate glfw keycodes to nebula ones

translate keycode

◆ CharFunc

void CharFunc ( const CoreGraphics::WindowId & id,
unsigned int key )
friend

Character callback.

◆ CloseFunc

void CloseFunc ( const CoreGraphics::WindowId & id)
friend

window close func

◆ CoreGraphics::DestroyWindow

◆ CoreGraphics::WindowNewFrame

◆ FocusFunc

void FocusFunc ( const CoreGraphics::WindowId & id,
int focus )
friend

window focus

◆ GLFWInputServer

friend class GLFWInputServer
friend

◆ GLFWWindow

friend class GLFWWindow
friend

◆ InternalSetupFunction

const CoreGraphics::WindowId InternalSetupFunction ( const CoreGraphics::WindowCreateInfo & info)
friend

internal setup function, either does embedding or ordinary opening

◆ KeyFunc

void KeyFunc ( const CoreGraphics::WindowId & id,
int key,
int scancode,
int action,
int mods )
friend

Keyboard callback.

◆ MouseButtonFunc

void MouseButtonFunc ( const CoreGraphics::WindowId & id,
int button,
int action,
int mods )
friend

Mouse Button callback.

◆ MouseFunc

void MouseFunc ( const CoreGraphics::WindowId & id,
double xpos,
double ypos )
friend

Mouse callback.

◆ MoveFunc

void MoveFunc ( const CoreGraphics::WindowId & id,
int x,
int y )
friend

Window move.

◆ OGL4RenderDevice

friend class OGL4RenderDevice
friend

◆ ResizeFunc

void ResizeFunc ( const CoreGraphics::WindowId & id,
int width,
int height )
friend

window resize

◆ ScrollFunc

void ScrollFunc ( const CoreGraphics::WindowId & id,
double xs,
double ys )
friend

Scroll callback.

Member Data Documentation

◆ graphicsEventHandler

Ptr<Graphics::GraphicsDisplayEventHandler> GLFW::GLFWDisplayDevice::graphicsEventHandler
protected

◆ inputEventHandler

Ptr<Input::InputDisplayEventHandler> GLFW::GLFWDisplayDevice::inputEventHandler
protected

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