All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
Luminous::Window Class Referenceabstract

Virtual base classes for OpenGL windows. More...

#include <Luminous/Window.hpp>

Inheritance diagram for Luminous::Window:
Luminous::CocoaWindow Luminous::QtWindow

Public Member Functions

virtual void deinit ()
 Cleanup any window resources. Default implementation does nothing.
 
virtual void doneCurrent ()=0
 Clears the OpenGL context for the calling thread.
 
WindowEventHookeventHook () const
 Get the event handler for the window. More...
 
virtual unsigned gpuId () const
 Gets the native GPU id for the OpenGL context of this window.
 
virtual int height () const =0
 Returns the height of the window. More...
 
virtual void init ()
 This function can be used to perform any initialization that must be executed in the render-thread associated with the window. More...
 
bool isFinished () const
 Queries if the window is closed. More...
 
virtual bool mainThreadInit ()
 This function can be used to perform any initialization that must be performed in the main-thread. More...
 
virtual void makeCurrent ()=0
 Sets the OpenGL context for the calling thread.
 
virtual void maximize ()=0
 Maximize the window.
 
virtual void minimize ()=0
 Minimize the window.
 
virtual void poll ()=0
 Update window system (mouse & keyboard) events.
 
virtual Nimble::Vector2i position () const =0
 Get the window position. More...
 
virtual void restore ()=0
 Restore the window from minimized state.
 
virtual void setEventHook (WindowEventHook *hook)
 Set the event handler for window events. More...
 
void setFullscreen (bool fullscreen)
 Sets the full-screen mode of the window. More...
 
virtual void setHeight (int h)=0
 Set the height of the window. More...
 
virtual bool setIcon (const QString &filename)=0
 Sets the icon for the window.
 
virtual void setPosition (Nimble::Vector2i pos)=0
 Set the window position. More...
 
virtual void setWidth (int w)=0
 Set the width of the window. More...
 
virtual void showCursor (bool visible)=0
 Control mouse cursor visibility. More...
 
virtual void swapBuffers ()=0
 Swap OpenGL buffers.
 
virtual int width () const =0
 Returns the width of the window. More...
 
 Window ()
 Construct an empty window with zero size.
 
virtual ~Window ()
 Destructor.
 

Detailed Description

Virtual base classes for OpenGL windows.

Member Function Documentation

WindowEventHook* Luminous::Window::eventHook ( ) const

Get the event handler for the window.

Returns
pointer to the event handler
virtual int Luminous::Window::height ( ) const
pure virtual

Returns the height of the window.

Returns
height of the window in pixels

Implemented in Luminous::CocoaWindow, and Luminous::QtWindow.

virtual void Luminous::Window::init ( )
inlinevirtual

This function can be used to perform any initialization that must be executed in the render-thread associated with the window.

bool Luminous::Window::isFinished ( ) const

Queries if the window is closed.

This would happen if the user closes the window.

Returns
true if the window has been closed
virtual bool Luminous::Window::mainThreadInit ( )
inlinevirtual

This function can be used to perform any initialization that must be performed in the main-thread.

Reimplemented in Luminous::QtWindow.

virtual Nimble::Vector2i Luminous::Window::position ( ) const
pure virtual

Get the window position.

Returns
window position

Implemented in Luminous::CocoaWindow, and Luminous::QtWindow.

virtual void Luminous::Window::setEventHook ( WindowEventHook hook)
virtual

Set the event handler for window events.

The event handler must remain valid for the lifetime of the window.

Parameters
hookevent handler
void Luminous::Window::setFullscreen ( bool  fullscreen)

Sets the full-screen mode of the window.

Parameters
fullscreentrue to enable fullscreen mode; false to disable it
virtual void Luminous::Window::setHeight ( int  h)
pure virtual

Set the height of the window.

Parameters
hwindow height in pixels

Implemented in Luminous::CocoaWindow, and Luminous::QtWindow.

virtual void Luminous::Window::setPosition ( Nimble::Vector2i  pos)
pure virtual

Set the window position.

Parameters
poswindow position

Implemented in Luminous::CocoaWindow, and Luminous::QtWindow.

virtual void Luminous::Window::setWidth ( int  w)
pure virtual

Set the width of the window.

Parameters
wwindow width in pixels

Implemented in Luminous::CocoaWindow, and Luminous::QtWindow.

virtual void Luminous::Window::showCursor ( bool  visible)
pure virtual

Control mouse cursor visibility.

Parameters
visibletrue to show cursor; false to hide it

Implemented in Luminous::CocoaWindow, and Luminous::QtWindow.

virtual int Luminous::Window::width ( ) const
pure virtual

Returns the width of the window.

Returns
width of the window in pixels

Implemented in Luminous::CocoaWindow, and Luminous::QtWindow.