Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Protected Member Functions | List of all members
om::graphics::textures::DeviceFramebuffer Class Referenceabstract

A class that enables render-to-texture by specifying textures and their attachment points. More...

#include <omGraphicsDeviceFramebuffer.h>

Inheritance diagram for om::graphics::textures::DeviceFramebuffer:
om::graphics::devices::DeviceResource om::graphics::devices::opengl::OpenGLFramebuffer

Public Member Functions

virtual Bool getTarget (const FramebufferAttachment &attachment, Shared< DeviceTexture > &target, TextureFace &face) const =0
 Get the texture and texture face that is attached at the specified framebuffer attachment point. More...
 
virtual Bool setTarget (const FramebufferAttachment &attachment, const Shared< DeviceTexture > &newTarget, TextureFace face=TextureFace::FRONT)=0
 Set the target texture for the specified framebuffer attachment point. More...
 
virtual void clearTargets ()=0
 Remove all attached target textures from this framebuffer. More...
 
Size getSize (Index dimension) const
 Return the minimum size of the framebuffer in pixels along the specified dimension index. More...
 
virtual Size getMinimumSize (Index dimension) const =0
 Return the minimum size of the framebuffer in pixels along the specified dimension index. More...
 
virtual Size getMaximumSize (Index dimension) const =0
 Return the maximum size of the framebuffer in pixels along the specified dimension index. More...
 
- Public Member Functions inherited from om::graphics::devices::DeviceResource
virtual ~DeviceResource ()
 Destroy a device object, releasing all internal state. More...
 
GraphicsContextgetContext () const
 Return a pointer to the graphics context associated with this DeviceResource. More...
 
virtual Bool isValid () const =0
 Return whether or not the state of this device resource is valid and able to be used for rendering. More...
 

Protected Member Functions

 DeviceFramebuffer (devices::GraphicsContext *context)
 Create an empty framebuffer for the given context with no attached textures. More...
 
- Protected Member Functions inherited from om::graphics::devices::DeviceResource
 DeviceResource (GraphicsContext *newContext)
 Create a new device object that is associated with the specified graphics context. More...
 

Detailed Description

A class that enables render-to-texture by specifying textures and their attachment points.

A Framebuffer object contains a set of associations between rendering framebuffer attachment points and textures which are to be used for render-to-texture. This framebuffer object can then be used as a render target, where the output of rendering will be sent to the texture targets specified here rather than the main screen.

Constructor & Destructor Documentation

om::graphics::textures::DeviceFramebuffer::DeviceFramebuffer ( devices::GraphicsContext context)
inlineprotected

Create an empty framebuffer for the given context with no attached textures.

Member Function Documentation

virtual Bool om::graphics::textures::DeviceFramebuffer::getTarget ( const FramebufferAttachment attachment,
Shared< DeviceTexture > &  target,
TextureFace face 
) const
pure virtual

Get the texture and texture face that is attached at the specified framebuffer attachment point.

If there is no attachment for that attachment point, the method has no effect and returns FALSE. Otherwise, the target texture and face are written to the output parameters and TRUE is returned.

Implemented in om::graphics::devices::opengl::OpenGLFramebuffer.

virtual Bool om::graphics::textures::DeviceFramebuffer::setTarget ( const FramebufferAttachment attachment,
const Shared< DeviceTexture > &  newTarget,
TextureFace  face = TextureFace::FRONT 
)
pure virtual

Set the target texture for the specified framebuffer attachment point.

If the specified Texture is valid and supports the specified texture face, and if the specified attachment point is supported and valid, the texture is used as the target for the specified attachment point and TRUE is returned indicating success. Otherwise, FALSE is returned indicating failure, leaving the framebuffer unchanged.

Implemented in om::graphics::devices::opengl::OpenGLFramebuffer.

virtual void om::graphics::textures::DeviceFramebuffer::clearTargets ( )
pure virtual

Remove all attached target textures from this framebuffer.

Implemented in om::graphics::devices::opengl::OpenGLFramebuffer.

Size om::graphics::textures::DeviceFramebuffer::getSize ( Index  dimension) const
inline

Return the minimum size of the framebuffer in pixels along the specified dimension index.

This method finds the smallest size of the attached textures along the given dimension. Indices start from 0 and count to d-1 for a framebuffer with d dimensions. Since framebuffers are almost always 1D or 2D, dimension indices greater than 1 will result in a size of 1 being returned, since even a 1x1 framebuffer has a 3D depth of 1 pixel.

If there are no attached textures, 0 is returned.

virtual Size om::graphics::textures::DeviceFramebuffer::getMinimumSize ( Index  dimension) const
pure virtual

Return the minimum size of the framebuffer in pixels along the specified dimension index.

This method finds the smallest size of the attached textures along the given dimension. Indices start from 0 and count to d-1 for a framebuffer with d dimensions. Since framebuffers are almost always 1D or 2D, dimension indices greater than 1 will result in a size of 1 being returned, since even a 1x1 framebuffer has a 3D depth of 1 pixel.

If there are no attached textures, 0 is returned.

Implemented in om::graphics::devices::opengl::OpenGLFramebuffer.

virtual Size om::graphics::textures::DeviceFramebuffer::getMaximumSize ( Index  dimension) const
pure virtual

Return the maximum size of the framebuffer in pixels along the specified dimension index.

This method finds the largest size of the attached textures along the given dimension. Indices start from 0 and count to d-1 for a framebuffer with d dimensions. Since framebuffers are almost always 1D or 2D, dimension indices greater than 1 will result in a size of 1 being returned, since even a 1x1 framebuffer has a 3D depth of 1 pixel.

If there are no attached textures, 0 is returned.

Implemented in om::graphics::devices::opengl::OpenGLFramebuffer.


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