Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members
Public Member Functions | Protected Member Functions | Protected Attributes
render::RenderWindow Class Reference

#include <RenderWindow.h>

Inheritance diagram for render::RenderWindow:
render::RenderTarget engine::Object

List of all members.

Public Member Functions

virtual void create (u32 width, u32 height, u32 colorDepth, bool fullScreen, u32 left, u32 top, bool depthBuffer, void *windowId=NULL)=0
virtual void destroy ()=0
 Destroys the window.
virtual void getMetrics (u32 &width, u32 &height, u32 &colorDepth, s32 &left, s32 &top)
virtual bool isActive () const
 Used to retrieve or set the active state of the render target.
virtual bool isClosed () const =0
 Indicates whether the window has been closed by the user.
virtual bool isFullScreen ()
 Returns true if window is running in fullscreen mode.
virtual bool isVisible () const
virtual void reposition (s32 left, s32 top)=0
 Reposition the window.
virtual void resize (u32 width, u32 height)=0
 Alter the size of the window.
virtual void setCaption (const std::string &text)=0
virtual void setFullscreen (bool fullScreen, u32 width, u32 height)
virtual void setVisible (bool visible)
 Set the visibility state.
virtual void swapBuffers (bool waitForVSync=true)=0
virtual void windowMovedOrResized ()
 Notify that the window has been resized.

Protected Member Functions

virtual void updateImpl (f32 elapsedTime)

Protected Attributes

bool mIsFullScreen
s32 mLeft
s32 mTop
void * mWindowId

Detailed Description

Manages the target rendering window.

This class handles a window into which the contents of a scene are rendered. There is a many-to-1 relationship between instances of this class an instance of RenderSystem which controls the rendering of the scene. There may be more than one window in the case of level editor tools etc. This class is abstract since there may be different implementations for different windowing systems.

Instances are created and communicated with by the render system although client programs can get a reference to it from the render system if required for resizing or moving. Note that you can have multiple viewpoints in the window for effects like rear-view mirrors and picture-in-picture views (see Viewport and Camera).


Member Function Documentation

virtual void render::RenderWindow::create ( u32  width,
u32  height,
u32  colorDepth,
bool  fullScreen,
u32  left,
u32  top,
bool  depthBuffer,
void *  windowId = NULL 
) [pure virtual]

Creates & displays the new window.

Parameters:
width,:The width of the window in pixels.
height,:The height of the window in pixels.
colorDepth,:The color depth in bits. Ignored if fullScreen is false since the desktop depth is used.
fullScreen,:If true, the window fills the screen, with no title bar or border.
left,:The x-position of the window. Ignored if fullScreen = true.
top,:The y-position of the window. Ignored if fullScreen = true.
depthBuffer,:Specify true to include a depth-buffer.
windowId,:Specify the windowID of the external window if needed.
virtual void render::RenderWindow::destroy ( ) [pure virtual]

Destroys the window.

void render::RenderWindow::getMetrics ( u32 width,
u32 height,
u32 colorDepth,
s32 left,
s32 top 
) [virtual]

Overloaded version of getMetrics from RenderTarget, including extra details specific to windowing systems.

References render::RenderTarget::mColorDepth, render::RenderTarget::mHeight, mLeft, mTop, and render::RenderTarget::mWidth.

bool render::RenderWindow::isActive ( ) const [virtual]

Used to retrieve or set the active state of the render target.

Reimplemented from render::RenderTarget.

References isVisible(), and render::RenderTarget::mActive.

Referenced by render::RenderManager::updateImpl().

virtual bool render::RenderWindow::isClosed ( ) const [pure virtual]

Indicates whether the window has been closed by the user.

bool render::RenderWindow::isFullScreen ( ) [virtual]

Returns true if window is running in fullscreen mode.

References mIsFullScreen.

bool render::RenderWindow::isVisible ( ) const [virtual]

Determine if the window is visible (not minimized or obscured).

This method returns true if the window is active i.e. is visible somewhere on screen, therefore should receive more images. The render system will use this to determine if it should bother rendering. If the window is minimised, the render will simply update the world and not bother rendering anything, to save CPU time.

Referenced by isActive().

virtual void render::RenderWindow::reposition ( s32  left,
s32  top 
) [pure virtual]

Reposition the window.

virtual void render::RenderWindow::resize ( u32  width,
u32  height 
) [pure virtual]

Alter the size of the window.

virtual void render::RenderWindow::setCaption ( const std::string &  text) [pure virtual]
void render::RenderWindow::setFullscreen ( bool  fullScreen,
u32  width,
u32  height 
) [virtual]

Alter fullscreen mode options.

Parameters:
fullScreen,:Whether to use fullscreen mode or not.
width,:The new width to use
height,:The new height to use
void render::RenderWindow::setVisible ( bool  visible) [virtual]

Set the visibility state.

virtual void render::RenderWindow::swapBuffers ( bool  waitForVSync = true) [pure virtual]

Swaps the frame buffers to display the next frame.

All render windows are double-buffered so that no 'in-progress' versions of the scene are displayed during rendering. Once rendering has completed (to an off-screen version of the window) the buffers are swapped to display the new frame.

Parameters:
waitForVSync,:If true, the system waits for the next vertical blank period (when the CRT beam turns off as it travels from bottom-right to top-left at the end of the pass) before flipping. If false, flipping occurs no matter what the beam position. Waiting for a vertical blank can be slower (and limits the framerate to the monitor refresh rate) but results in a steadier image with no 'tearing' (a flicker resulting from flipping buffers when the beam is in the progress of drawing the last frame).

Referenced by updateImpl().

void render::RenderWindow::updateImpl ( f32  elapsedTime) [protected, virtual]

Reimplemented from render::RenderTarget.

References swapBuffers().

void render::RenderWindow::windowMovedOrResized ( ) [virtual]

Notify that the window has been resized.


Member Data Documentation

Referenced by isFullScreen().

Referenced by getMetrics().

Referenced by getMetrics().


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

The KG Game Engine
The KG Game Engine Documentation © 2006-2011 by Kat'Oun. Generated on Sat Jul 2 2011 00:50:09 by Doxygen (1.7.4)