Ocular Engine
Ocular::Core::AWindow Class Referenceabstract
Inheritance diagram for Ocular::Core::AWindow:
Ocular::Core::Object Ocular::Core::AEventListener Ocular::Core::ObjectIO Ocular::Core::Exposable Ocular::Core::Buildable

Public Member Functions

 AWindow (WindowDescriptor const &descriptor)
 
virtual bool onEvent (std::shared_ptr< AEvent > event) override
 
void resize (uint32_t width, uint32_t height)
 
WindowDescriptor getDescriptor () const
 
void setDescriptor (WindowDescriptor const &descriptor)
 
bool hasFocus () const
 
Graphics::RenderTexturegetRenderTexture ()
 
void setRenderTexture (Graphics::RenderTexture *renderTexture)
 
Graphics::DepthTexturegetDepthTexture ()
 
void setDepthTexture (Graphics::DepthTexture *depthTexture)
 
virtual void showCursor (bool show)
 
void * getOSPointer () const
 
- Public Member Functions inherited from Ocular::Core::Object
 Object (std::string name, std::string className)
 Creates a new Object with the specified name and class. More...
 
 Object (std::string name)
 Creates a new Object with the specified name. More...
 
 Object ()
 Creates a new Object with the default name ('Name').
 
std::string const & getName () const
 
void setName (std::string name)
 Sets the name of the Object. More...
 
std::string const & getClass () const
 
void setUUID (std::string const &uuid)
 
UUID const & getUUID () const
 
int64_t getCreationTime () const
 
virtual std::string toString () const
 
template<class T >
bool isType ()
 
- Public Member Functions inherited from Ocular::Core::ObjectIO
virtual void onLoad (BuilderNode const *node) override
 
virtual void onSave (BuilderNode *node) const override
 
- Public Member Functions inherited from Ocular::Core::Exposable
void getAllExposedNames (std::vector< std::string > &names) const
 
bool getVariable (std::string const &name, ExposedVariable &var)
 
template<typename T >
bool getVariableValue (std::string const &name, T &var)
 
template<typename T >
bool setVariableValue (std::string const &name, T const &value)
 
virtual void onVariableModified (std::string const &varName)
 

Protected Member Functions

virtual void open ()=0
 
virtual void update (uint64_t time)=0
 
virtual void close ()=0
 
- Protected Member Functions inherited from Ocular::Core::Exposable
void exposeVariable (std::string const &name, std::string const &type, bool isPointer, bool isExposed, void *data)
 

Protected Attributes

WindowDescriptor m_Descriptor
 
Graphics::RenderTexturem_RenderTexture
 
Graphics::DepthTexturem_DepthTexture
 
void * m_OSPointer
 
- Protected Attributes inherited from Ocular::Core::Object
std::string m_Name
 
std::string m_Class
 
UUID m_UUID
 
const int64_t m_CreationTime
 
- Protected Attributes inherited from Ocular::Core::Exposable
std::unordered_map< std::string, ExposedVariablem_ExposedVariables
 

Friends

class WindowManager
 

Constructor & Destructor Documentation

Ocular::Core::AWindow::AWindow ( WindowDescriptor const &  descriptor)
Parameters
nameDisplay name of the window
widthWidth of the window
heightHeight of the window
colorBitsNumber of color bits
depthBitsNumber of depth bits
stencilBitsNumber of stencil bits
displayDisplay mode
alwaysOnTopShould this Window be rendered on top of other Windows? (Exclusive mode rendering)

Member Function Documentation

virtual void Ocular::Core::AWindow::close ( )
protectedpure virtual

Closes the Window.

Graphics::DepthTexture * Ocular::Core::AWindow::getDepthTexture ( )
Returns
The current depth texture.
WindowDescriptor Ocular::Core::AWindow::getDescriptor ( ) const
Returns
The WindowDescriptor for this window instance.
void * Ocular::Core::AWindow::getOSPointer ( ) const

Returns the raw Operating System specific pointer for this window. This can be cast to HWND on Windows, etc.

Graphics::RenderTexture * Ocular::Core::AWindow::getRenderTexture ( )
Returns
The current backbuffer render texture.
bool Ocular::Core::AWindow::hasFocus ( ) const
Returns
TRUE if this window currently has input focus.
bool Ocular::Core::AWindow::onEvent ( std::shared_ptr< AEvent event)
overridevirtual
Returns
TRUE to keep processing this event after this listener, FALSE to consume this event

Implements Ocular::Core::AEventListener.

virtual void Ocular::Core::AWindow::open ( )
protectedpure virtual

Opens and initializes the Window.

void Ocular::Core::AWindow::resize ( uint32_t  width,
uint32_t  height 
)

If the window dimensions do not already match the specified width/height, then the window will be resized. In addition to this, the descriptor, render target, and depth stencil textures will be updated and recreated to match the new dimensions.

Parameters
[in]width
[in]height
void Ocular::Core::AWindow::setDepthTexture ( Graphics::DepthTexture depthTexture)

Sets the DepthTexture to use for depth values.

This method is typically called automatically during window creation and/or GraphicsDriver initialization. Except for special circumstances it should not be called externally.

Note
When set, the window assumes owndership of the texture and will destroy it when it is no longer in use.
Parameters
[in]depthTexture
void Ocular::Core::AWindow::setDescriptor ( WindowDescriptor const &  descriptor)

Sets the WindowDescriptor for this window instance.

Parameters
[in]descriptor
void Ocular::Core::AWindow::setRenderTexture ( Graphics::RenderTexture renderTexture)

Sets the RenderTexture to use as the backbuffer.

This method is typically called automatically during window creation and/or GraphicsDriver initialization. Except for special circumstances it should not be called externally.

Note
When set, the window assumes ownership of the texture and will destroy it when it is no longer in use.
Parameters
[in]renderTexture
void Ocular::Core::AWindow::showCursor ( bool  show)
virtual

Turns the cursor on and off.

Parameters
[in]showIf TRUE, the cursor is displayed while the window has focus.
virtual void Ocular::Core::AWindow::update ( uint64_t  time)
protectedpure virtual

Updates and recreates the Window.


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