#include <BALL/VIEW/RENDERING/renderWindow.h>
Public Member Functions | |
RenderWindow () | |
virtual | ~RenderWindow () |
virtual bool | init () |
virtual bool | resize (const unsigned int width, const unsigned int height) |
virtual void | refresh () |
virtual FrameBufferPtr | getBuffer () throw (BALL::Exception::NoBufferAvailable) |
virtual FrameBufferFormat | getFormat () const |
virtual void | releaseBuffer (FrameBufferPtr buffer) |
virtual void | prepareRendering () |
Protected Attributes | |
t_PixelPtr | m_pixels |
FrameBufferPtr | m_framebuffer |
FrameBufferFormat | m_fmt |
const PixelFormat | m_pfm |
bool | m_bufferLocked |
const unsigned int | m_minimalWidth |
const unsigned int | m_minimalHeight |
Private Types | |
typedef boost::shared_array < taPixelDatatype > | t_PixelPtr |
Private Member Functions | |
BALLVIEW_STATIC_ASSERT_TYPE_IS_INT_OR_FLOAT (taPixelDatatype) |
General rendering window interface. Such a window represents a surface on a screen or other device, where a buffer encapsulated by RenderTarget interface can be displayed
typedef boost::shared_array<taPixelDatatype> BALL::VIEW::RenderWindow< taPixelDatatype >::t_PixelPtr [private] |
BALL::VIEW::RenderWindow< taPixelDatatype >::RenderWindow | ( | ) |
virtual BALL::VIEW::RenderWindow< taPixelDatatype >::~RenderWindow | ( | ) | [virtual] |
BALL::VIEW::RenderWindow< taPixelDatatype >::BALLVIEW_STATIC_ASSERT_TYPE_IS_INT_OR_FLOAT | ( | taPixelDatatype | ) | [private] |
virtual FrameBufferPtr BALL::VIEW::RenderWindow< taPixelDatatype >::getBuffer | ( | ) | throw (BALL::Exception::NoBufferAvailable) [virtual] |
Returns a buffer where the image data can be stored in the format specified in the constructor. The buffer will remain valid until update() is called with that buffer. Each call to getBuffer() creates a new FrameBuffer. If no new FrameBuffer can be created for this RenderTarget (e.g. if the RenderTarget supports only a single buffer at a time), a NoBufferAvailable exception is thrown.
Implements BALL::VIEW::RenderTarget.
virtual FrameBufferFormat BALL::VIEW::RenderWindow< taPixelDatatype >::getFormat | ( | ) | const [virtual] |
Implements BALL::VIEW::RenderTarget.
virtual bool BALL::VIEW::RenderWindow< taPixelDatatype >::init | ( | ) | [virtual] |
Initialization routine.
Implements BALL::VIEW::RenderTarget.
Reimplemented in BALL::VIEW::GLRenderWindow.
virtual void BALL::VIEW::RenderWindow< taPixelDatatype >::prepareRendering | ( | ) | [inline, virtual] |
Implements BALL::VIEW::RenderTarget.
Reimplemented in BALL::VIEW::GLOffscreenTarget.
virtual void BALL::VIEW::RenderWindow< taPixelDatatype >::refresh | ( | ) | [virtual] |
Request that the image is actually displayed on the screen or other device the window encapsulated. You should implement this method in subclass. This is different from RenderTarget releaseBuffer. ReleaseBuffer only informs the window that a buffer is ready, but does not imply the buffer is actually displayed somewhere. This is done by refresh. On the other hand, refresh called inbetween getBuffer and releaseBuffer has no effect.
Implements BALL::VIEW::RenderTarget.
Reimplemented in BALL::VIEW::GLOffscreenTarget, and BALL::VIEW::GLRenderWindow.
virtual void BALL::VIEW::RenderWindow< taPixelDatatype >::releaseBuffer | ( | FrameBufferPtr | buffer | ) | [virtual] |
Notify the RenderTarget that the buffer has changed. The Renderer has to call this once it has filled the buffer (i.e. after each frame). This may cause the buffer to become invalid. Therefore, the Renderer should get a new buffer for the next frame (with getBuffer()).
Implements BALL::VIEW::RenderTarget.
virtual bool BALL::VIEW::RenderWindow< taPixelDatatype >::resize | ( | const unsigned int | width, | |
const unsigned int | height | |||
) | [virtual] |
Request new window size. Returns false if such a size cannot be supplied This call must be made before the window buffer is handed out to be rendered. This precondition is being checked automatically, see getBuffer
Implements BALL::VIEW::RenderTarget.
Reimplemented in BALL::VIEW::GLOffscreenTarget, and BALL::VIEW::GLRenderWindow.
bool BALL::VIEW::RenderWindow< taPixelDatatype >::m_bufferLocked [protected] |
FrameBufferFormat BALL::VIEW::RenderWindow< taPixelDatatype >::m_fmt [protected] |
FrameBufferPtr BALL::VIEW::RenderWindow< taPixelDatatype >::m_framebuffer [protected] |
const unsigned int BALL::VIEW::RenderWindow< taPixelDatatype >::m_minimalHeight [protected] |
const unsigned int BALL::VIEW::RenderWindow< taPixelDatatype >::m_minimalWidth [protected] |
const PixelFormat BALL::VIEW::RenderWindow< taPixelDatatype >::m_pfm [protected] |
t_PixelPtr BALL::VIEW::RenderWindow< taPixelDatatype >::m_pixels [protected] |