ork::FrameBuffer Class Reference
[render]

A framebuffer, either the default one or a frame buffer object. More...

#include <FrameBuffer.h>

Inheritance diagram for ork::FrameBuffer:
ork::Object

List of all members.

Classes

class  Parameters
 The state of a FrameBuffer. More...

Public Member Functions

 FrameBuffer ()
 Creates a new frambuffer.
virtual ~FrameBuffer ()
 Deletes this framebuffer.
ptr< RenderBuffergetRenderBuffer (BufferId b)
 Returns the render buffer attached to the given attachment point.
ptr< TexturegetTextureBuffer (BufferId b)
 Returns the texture attached to the given attachment point.
void setRenderBuffer (BufferId b, const ptr< RenderBuffer > t)
 Sets an attachment of this framebuffer using a render buffer.
void setTextureBuffer (BufferId b, const ptr< Texture1D > t, int level)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< Texture1DArray > t, int level, int layer)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< Texture2D > t, int level)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< TextureRectangle > t, int level)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< Texture2DMultisample > t)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< Texture2DArray > t, int level, int layer)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< Texture2DMultisampleArray > t, int layer)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< Texture3D > t, int level, int layer)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< TextureCube > t, int level, CubeFace cf)
 Sets an attachment of this framebuffer using a texture.
void setTextureBuffer (BufferId b, const ptr< TextureCubeArray > t, int level, CubeFace cf)
 Sets an attachment of this framebuffer using a texture.
void setReadBuffer (BufferId b)
 Sets the read buffer for readPixels and copyPixels methods.
void setDrawBuffer (BufferId b)
 Sets the draw buffer for clear and draw methods.
void setDrawBuffers (BufferId b)
 Sets the draw buffers for clear and draw methods.
Parameters getParameters ()
 Returns the current parameters of this framebuffer.
vec4< GLint > getViewport ()
 Returns this framebuffer's viewport.
vec2< GLfloat > getDepthRange ()
 Returns this framebuffer's depth range.
GLint getClipDistances ()
 Returns this framebuffer's clip distances mask.
vec4< GLfloat > getClearColor ()
 Returns the value used to clear the color buffer.
GLfloat getClearDepth ()
 Returns the value used to clear the depth buffer.
GLint getClearStencil ()
 Returns the value used to clear the stencil buffer.
GLfloat getPointSize ()
 Returns the point primitive's size.
GLfloat getPointFadeThresholdSize ()
 Returns the point's fade threshold size.
bool getPointLowerLeftOrigin ()
 Returns the left origin of the point primitive.
GLfloat getLineWidth ()
 Returns the line primitive's width.
bool getLineSmooth ()
 Retursn true if AA is enabled for lines.
bool getFrontFaceCW ()
 Returns true if front faces are clockwise.
vec2< PolygonMode > getPolygonMode ()
 Returns the polygon mode for front and back faces cull state.
bool getPolygonSmooth ()
 Returns true if AA is enabled for polygons.
vec2< GLfloat > getPolygonOffset ()
 Returns factor and units used to offset the depth value.
vec3< bool > getPolygonOffsets ()
 Returns the types of primitives that must be offset (points, lines, and polygons).
bool getMultiSample ()
 Returns true if multisampling is enabled.
vec2< bool > getSampleAlpha ()
 Returns the values for alpha sampling.
GLfloat getSampleCoverage ()
 Returns the sample coverage.
GLint getSampleMask ()
 Returns the sample mask.
bool getSampleShading (GLfloat &minsamples)
 Returns true if AA is enabled on multi-sampling.
ptr< QuerygetOcclusionTest (QueryMode &occlusionMode)
 Returns the occlusion test and its mode.
bool getScissorTest ()
 Returns True if Scissor test is enabled.
bool getScissorTest (vec4< GLint > &scissor)
 Returns True if Scissor test is enabled.
bool getStencilTest ()
 Returns true if stencil test is enabled.
bool getStencilTest (Function &ff, GLint &fref, GLint &fmask, StencilOperation &ffail, StencilOperation &fdpfail, StencilOperation &fdppass)
 Returns true if stencil test is enabled.
bool getStencilTest (Function &ff, GLint &fref, GLint &fmask, StencilOperation &ffail, StencilOperation &fdpfail, StencilOperation &fdppass, Function &bf, GLint &bref, GLint &bmask, StencilOperation &bfail, StencilOperation &bdpfail, StencilOperation &bdppass)
 Returns true if stencil test is enabled.
bool getDepthTest ()
 Returns true if depth test is enabled.
bool getDepthTest (Function &depth)
 Returns true if depth test is enabled.
bool getBlend (BufferId buffer=BufferId(-1))
 Returns true if blending is enabled for specified buffer.
bool getBlend (BufferId buffer, BlendEquation &rgb, BlendArgument &srgb, BlendArgument &drgb)
 Returns true if blending is enabled for specified buffer.
bool getBlend (BufferId buffer, BlendEquation &rgb, BlendArgument &srgb, BlendArgument &drgb, BlendEquation &alpha, BlendArgument &salpha, BlendArgument &dalpha)
 Returns true if blending is enabled for specified buffer.
vec4< GLfloat > getBlendColor ()
 Returns the current blending color parameter.
bool getDither ()
 Returns true if dithering is enabled.
bool getLogicOp ()
 Returns true if logical operation is enabled.
bool getLogicOp (LogicOperation &logicOp)
 Returns true if logical operation is enabled.
vec4< bool > getColorMask (BufferId buffer=BufferId(-1))
 Returns the color writing mask for the given buffer.
bool getDepthMask ()
 Returns the depth buffer writing mask.
vec2< GLint > getStencilMask ()
 Returns the stencil buffer writing mask.
void setParameters (const Parameters &p)
 Sets all the parameters of this framebuffer at once.
void setViewport (const vec4< GLint > &viewport)
 Sets the viewport for this framebuffer (up, down, left and right planes).
void setDepthRange (GLfloat n, GLfloat f)
 Sets the depth range for this framebuffer (near and far planes).
void setClipDistances (int clipDistances)
 Sets the clipping bit, used to determine which planes will be used for clipping.
void setClearColor (const vec4< GLfloat > &clearColor)
 Sets the color used to clear the current draw buffer.
void setClearDepth (GLfloat clearDepth)
 Sets the depth used to clear the current depth buffer.
void setClearStencil (GLint clearStencil)
 Sets the stencil used to clear the current stencil buffer.
void setPointSize (GLfloat pointSize)
 Sets the point primitive's size.
void setPointFadeThresholdSize (GLfloat pointFadeThresholdSize)
 Sets the maximum size of a point.
void setPointLowerLeftOrigin (bool pointLowerLeftOrigin)
 Sets the origin corner of a point.
void setLineWidth (GLfloat lineWidth)
 Sets the line primitive's width.
void setLineSmooth (bool lineSmooth)
 Enables or disables the AA on line drawing.
void setFrontFaceCW (bool frontFaceCW)
 Determines the orientation of front faces.
void setPolygonMode (PolygonMode polygonFront, PolygonMode polygonBack)
 Sets the polygon mode for front and back faces.
void setPolygonSmooth (bool polygonSmooth)
 Enables or disables AA on polygon drawing.
void setPolygonOffset (GLfloat factor, GLfloat units)
 Sets the factor and units when using offsets on primitives.
void setPolygonOffset (bool pointOffset, bool lineOffset, bool polygonOffset)
 Determines which primitives should be offset.
void setMultisample (bool multiSample)
 Enables or disables multisampling.
void setSampleAlpha (bool sampleAlphaToCoverage, bool sampleAlphaToOne)
 Sets sampling filter options.
void setSampleCoverage (GLfloat sampleCoverage)
 Sets sampling coverage.
void setSampleMask (GLbitfield sampleMask)
 Sets sampling mask.
void setSampleShading (bool sampleShading, GLfloat minSamples)
 Enables or disables AA on multisampling.
void setOcclusionTest (ptr< Query > occlusionQuery, QueryMode occlusionMode)
 Adds an occlusion query.
void setScissorTest (bool enableScissor)
 Enables or disables scissor test.
void setScissorTest (bool enableScissor, const vec4< GLint > &scissor)
 Enables or disables scissor test.
void setStencilTest (bool enableStencil)
 Enables or disables stencil test.
void setStencilTest (bool enableStencil, Function f, GLint ref, GLuint mask, StencilOperation sfail, StencilOperation dpfail, StencilOperation dppass)
 Enables or disables stencil test.
void setStencilTest (bool enableStencil, Function ff, GLint fref, GLuint fmask, StencilOperation ffail, StencilOperation fdpfail, StencilOperation fdppass, Function bf, GLint bref, GLuint bmask, StencilOperation bfail, StencilOperation bdpfail, StencilOperation bdppass)
 Enables or disables stencil test.
void setDepthTest (bool enableDepth)
 Enables or disables depth test.
void setDepthTest (bool enableDepth, Function depth)
 Enables or disables depth test.
void setBlend (bool enableBlend)
 Enables or disables blending.
void setBlend (BufferId buffer, bool enableBlend)
 Enables or disables blending for a given buffer.
void setBlend (bool enableBlend, BlendEquation e, BlendArgument src, BlendArgument dst)
 Enables or disables blending.
void setBlend (BufferId buffer, bool enableBlend, BlendEquation e, BlendArgument src, BlendArgument dst)
 Enables or disables blending for a given buffer.
void setBlend (bool enableBlend, BlendEquation rgb, BlendArgument srgb, BlendArgument drgb, BlendEquation alpha, BlendArgument salpha, BlendArgument dalpha)
 Enables or disables blending.
void setBlend (BufferId buffer, bool enableBlend, BlendEquation rgb, BlendArgument srgb, BlendArgument drgb, BlendEquation alpha, BlendArgument salpha, BlendArgument dalpha)
 Enables or disables blending for a given buffer.
void setBlendColor (const vec4< GLfloat > &color)
 Sets Blend color parameter.
void setDither (bool enableDither)
 Enables or disables dithering.
void setLogicOp (bool enableLogic)
 Enables or disables logical operation.
void setLogicOp (bool enableLogic, LogicOperation logicOp)
 Enables or disables logical operation.
void setColorMask (bool r, bool g, bool b, bool a)
 Sets color buffer's writing mask.
void setColorMask (BufferId buffer, bool r, bool g, bool b, bool a)
 Sets color buffer's writing mask.
void setDepthMask (bool d)
 Sets depth buffer's writing mask.
void setStencilMask (GLuint frontMask, GLuint backMask)
 Sets stencil buffer's writing mask.
void clear (bool color, bool stencil, bool depth)
 Clears the buffers attached to this framebuffer.
template<class vertex , class index >
void draw (ptr< Program > p, const Mesh< vertex, index > &mesh, int primCount=1)
 Draws the given mesh.
void draw (ptr< Program > p, const MeshBuffers &mesh, MeshMode m, GLint first, GLsizei count, GLsizei primCount=1, GLint base=0)
 Draws a part of a mesh one or more times.
void multiDraw (ptr< Program > p, const MeshBuffers &mesh, MeshMode m, GLint *firsts, GLsizei *counts, GLsizei primCount, GLint *bases=0)
 Draws several parts of a mesh.
void drawIndirect (ptr< Program > p, const MeshBuffers &mesh, MeshMode m, const Buffer &buf)
 Draws a part of a mesh one or more times.
void drawFeedback (ptr< Program > p, MeshMode m, const TransformFeedback &tfb, int stream=0)
 Draws the mesh resulting from a transform feedback session.
void drawQuad (ptr< Program > p)
 Draws a quad mesh.
void readPixels (int x, int y, int w, int h, TextureFormat f, PixelType t, const Buffer::Parameters &s, const Buffer &dstBuf, bool clamp=false)
 Reads pixels from the attached color buffers into the given buffer.
void copyPixels (int xoff, int x, int y, int w, const Texture1D &dst, int level)
 Copies pixels from the attached color buffers into the given texture.
void copyPixels (int xoff, int layer, int x, int y, int w, int d, const Texture1DArray &dst, int level)
 Copies pixels from the attached color buffers into the given texture.
void copyPixels (int xoff, int yoff, int x, int y, int w, int h, const Texture2D &dst, int level)
 Copies pixels from the attached color buffers into the given texture.
void copyPixels (int xoff, int yoff, int layer, int x, int y, int w, int h, const Texture2DArray &dst, int level)
 Copies pixels from the attached color buffers into the given texture.
void copyPixels (int xoff, int yoff, int zoff, int x, int y, int w, int h, const Texture3D &dst, int level)
 Copies pixels from the attached color buffers into the given texture.
void copyPixels (int xoff, int yoff, int x, int y, int w, int h, const TextureCube &dst, int level, CubeFace cf)
 Copies pixels from the attached color buffers into the given texture.
void copyPixels (int xoff, int yoff, int layer, int x, int y, int w, int h, const TextureCubeArray &dst, int level, CubeFace cf)
 Copies pixels from the attached color buffers into the given texture.
void copyPixels (int xoff, int yoff, int x, int y, int w, int h, const TextureRectangle &dst, int level)
 Copies pixels from the attached color buffers into the given texture.

Static Public Member Functions

static ptr< FrameBuffergetDefault ()
 Returns the default, onscreen framebuffer.
static GLint getMajorVersion ()
 Returns the OpenGL major version.
static GLint getMinorVersion ()
 Returns the OpenGL minor version.
static GLenum getError ()
 Returns the OpenGL state.
static void resetAllStates ()
 Resets all the internal Ork specific state.

Detailed Description

A framebuffer, either the default one or a frame buffer object.

Each framebuffer has its own state, made of attachments and fixed functions parameters.


Constructor & Destructor Documentation

ork::FrameBuffer::FrameBuffer (  ) 

Creates a new frambuffer.

This creates an offsreen framebuffer. The default framebuffer can be retrieved with getDefault.

virtual ork::FrameBuffer::~FrameBuffer (  )  [virtual]

Deletes this framebuffer.


Member Function Documentation

void ork::FrameBuffer::clear ( bool  color,
bool  stencil,
bool  depth 
)

Clears the buffers attached to this framebuffer.

Parameters:
color true to clear the attached color buffers.
stencil true to clear the attached stencil buffer.
depth true to clear the attached depth buffer.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  yoff,
int  x,
int  y,
int  w,
int  h,
const TextureRectangle dst,
int  level 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
yoff y offset in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
h height of the area where the pixels must be read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  yoff,
int  layer,
int  x,
int  y,
int  w,
int  h,
const TextureCubeArray dst,
int  level,
CubeFace  cf 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
yoff y offset in the destination texture.
layer destination layer in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
h height of the area where the pixels must be read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
cf destination face for the read pixels.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  yoff,
int  x,
int  y,
int  w,
int  h,
const TextureCube dst,
int  level,
CubeFace  cf 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
yoff y offset in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
h height of the area where the pixels must be read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
cf destination face for the read pixels.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  yoff,
int  zoff,
int  x,
int  y,
int  w,
int  h,
const Texture3D dst,
int  level 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
yoff y offset in the destination texture.
zoff z offset in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
h height of the area where the pixels must be read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  yoff,
int  layer,
int  x,
int  y,
int  w,
int  h,
const Texture2DArray dst,
int  level 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
yoff y offset in the destination texture.
layer destination layer in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
h height of the area where the pixels must be read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  yoff,
int  x,
int  y,
int  w,
int  h,
const Texture2D dst,
int  level 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
yoff y offset in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
h height of the area where the pixels must be read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  layer,
int  x,
int  y,
int  w,
int  d,
const Texture1DArray dst,
int  level 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
layer destination layer in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
d number of layers to read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
void ork::FrameBuffer::copyPixels ( int  xoff,
int  x,
int  y,
int  w,
const Texture1D dst,
int  level 
)

Copies pixels from the attached color buffers into the given texture.

Parameters:
xoff x offset in the destination texture.
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
dst destination texture for the read pixels.
level destination LOD level for the read pixels.
void ork::FrameBuffer::draw ( ptr< Program p,
const MeshBuffers mesh,
MeshMode  m,
GLint  first,
GLsizei  count,
GLsizei  primCount = 1,
GLint  base = 0 
)

Draws a part of a mesh one or more times.

Parameters:
p the program to use to draw the mesh.
mesh the mesh to draw.
m how the mesh vertices must be interpreted.
first the first vertex to draw, or the first indice to draw if this mesh has indices.
count the number of vertices to draw, or the number of indices to draw if this mesh has indices.
primCount the number of times this mesh must be drawn (with geometry instancing).
base the base vertex to use. Only used for meshes with indices.
template<class vertex , class index >
void ork::FrameBuffer::draw ( ptr< Program p,
const Mesh< vertex, index > &  mesh,
int  primCount = 1 
) [inline]

Draws the given mesh.

Parameters:
p the program to use to draw the mesh.
mesh the mesh to draw.
primCount the number of times this mesh must be instanced.
void ork::FrameBuffer::drawFeedback ( ptr< Program p,
MeshMode  m,
const TransformFeedback tfb,
int  stream = 0 
)

Draws the mesh resulting from a transform feedback session.

Only available with OpenGL 4.0 or more.

Parameters:
p the program to use to draw the mesh.
m how the mesh vertices must be interpreted.
tfb a TransformFeedback containing the results of a transform feedback session.
stream the stream to draw.
void ork::FrameBuffer::drawIndirect ( ptr< Program p,
const MeshBuffers mesh,
MeshMode  m,
const Buffer buf 
)

Draws a part of a mesh one or more times.

Only available with OpenGL 4.0 or more.

Parameters:
p the program to use to draw the mesh.
mesh the mesh to draw.
m how the mesh vertices must be interpreted.
buf a CPU or GPU buffer containing the 'count', 'primCount', 'first' and 'base' parameters, in this order, followed by '0', as 32 bit integers.
void ork::FrameBuffer::drawQuad ( ptr< Program p  ) 

Draws a quad mesh.

This mesh has a position attribute made of four floats. xy coordinates vary between -1 and 1, while zw coordinates vary between 0 and 1.

bool ork::FrameBuffer::getBlend ( BufferId  buffer,
BlendEquation &  rgb,
BlendArgument &  srgb,
BlendArgument &  drgb,
BlendEquation &  alpha,
BlendArgument &  salpha,
BlendArgument &  dalpha 
)

Returns true if blending is enabled for specified buffer.

If no buffer is specified, will use default buffer.

Parameters:
buffer an optionnal buffer id.
[out] rgb the current color blending equation.
[out] srgb the current source color blending argument.
[out] drgb the current destination color blending argument.
[out] alpha the current alpha blending equation.
[out] salpha the current source alpha blending argument.
[out] dalpha the current destination alpha blending argument.
bool ork::FrameBuffer::getBlend ( BufferId  buffer,
BlendEquation &  rgb,
BlendArgument &  srgb,
BlendArgument &  drgb 
)

Returns true if blending is enabled for specified buffer.

If no buffer is specified, will use default buffer.

Parameters:
buffer an optionnal buffer id.
[out] rgb the current color blending equation.
[out] srgb the current source color blending argument.
[out] drgb the current destination color blending argument.
bool ork::FrameBuffer::getBlend ( BufferId  buffer = BufferId(-1)  ) 

Returns true if blending is enabled for specified buffer.

If no buffer is specified, will use default buffer.

Parameters:
buffer an optionnal buffer id.
vec4<GLfloat> ork::FrameBuffer::getBlendColor (  ) 

Returns the current blending color parameter.

vec4<GLfloat> ork::FrameBuffer::getClearColor (  ) 

Returns the value used to clear the color buffer.

GLfloat ork::FrameBuffer::getClearDepth (  ) 

Returns the value used to clear the depth buffer.

GLint ork::FrameBuffer::getClearStencil (  ) 

Returns the value used to clear the stencil buffer.

GLint ork::FrameBuffer::getClipDistances (  ) 

Returns this framebuffer's clip distances mask.

vec4<bool> ork::FrameBuffer::getColorMask ( BufferId  buffer = BufferId(-1)  ) 

Returns the color writing mask for the given buffer.

static ptr<FrameBuffer> ork::FrameBuffer::getDefault (  )  [static]

Returns the default, onscreen framebuffer.

bool ork::FrameBuffer::getDepthMask (  ) 

Returns the depth buffer writing mask.

vec2<GLfloat> ork::FrameBuffer::getDepthRange (  ) 

Returns this framebuffer's depth range.

bool ork::FrameBuffer::getDepthTest ( Function &  depth  ) 

Returns true if depth test is enabled.

Parameters:
[out] depth the current depth test function.
bool ork::FrameBuffer::getDepthTest (  ) 

Returns true if depth test is enabled.

bool ork::FrameBuffer::getDither (  ) 

Returns true if dithering is enabled.

static GLenum ork::FrameBuffer::getError (  )  [static]

Returns the OpenGL state.

Returns:
the error code of the last invalid operation, or 0 if all operations executed normally.
bool ork::FrameBuffer::getFrontFaceCW (  ) 

Returns true if front faces are clockwise.

bool ork::FrameBuffer::getLineSmooth (  ) 

Retursn true if AA is enabled for lines.

GLfloat ork::FrameBuffer::getLineWidth (  ) 

Returns the line primitive's width.

bool ork::FrameBuffer::getLogicOp ( LogicOperation &  logicOp  ) 

Returns true if logical operation is enabled.

Parameters:
logicOp the current logical operation.
bool ork::FrameBuffer::getLogicOp (  ) 

Returns true if logical operation is enabled.

static GLint ork::FrameBuffer::getMajorVersion (  )  [static]

Returns the OpenGL major version.

static GLint ork::FrameBuffer::getMinorVersion (  )  [static]

Returns the OpenGL minor version.

bool ork::FrameBuffer::getMultiSample (  ) 

Returns true if multisampling is enabled.

ptr<Query> ork::FrameBuffer::getOcclusionTest ( QueryMode &  occlusionMode  ) 

Returns the occlusion test and its mode.

Parameters ork::FrameBuffer::getParameters (  ) 

Returns the current parameters of this framebuffer.

GLfloat ork::FrameBuffer::getPointFadeThresholdSize (  ) 

Returns the point's fade threshold size.

bool ork::FrameBuffer::getPointLowerLeftOrigin (  ) 

Returns the left origin of the point primitive.

GLfloat ork::FrameBuffer::getPointSize (  ) 

Returns the point primitive's size.

vec2<PolygonMode> ork::FrameBuffer::getPolygonMode (  ) 

Returns the polygon mode for front and back faces cull state.

vec2<GLfloat> ork::FrameBuffer::getPolygonOffset (  ) 

Returns factor and units used to offset the depth value.

vec3<bool> ork::FrameBuffer::getPolygonOffsets (  ) 

Returns the types of primitives that must be offset (points, lines, and polygons).

bool ork::FrameBuffer::getPolygonSmooth (  ) 

Returns true if AA is enabled for polygons.

ptr<RenderBuffer> ork::FrameBuffer::getRenderBuffer ( BufferId  b  ) 

Returns the render buffer attached to the given attachment point.

Returns:
the render buffer attached to the given attachment point, or NULL if there is no renderbuffer bound to this attachment point (either because nothing is attached, or because a texture is attached).
vec2<bool> ork::FrameBuffer::getSampleAlpha (  ) 

Returns the values for alpha sampling.

GLfloat ork::FrameBuffer::getSampleCoverage (  ) 

Returns the sample coverage.

GLint ork::FrameBuffer::getSampleMask (  ) 

Returns the sample mask.

bool ork::FrameBuffer::getSampleShading ( GLfloat &  minsamples  ) 

Returns true if AA is enabled on multi-sampling.

bool ork::FrameBuffer::getScissorTest ( vec4< GLint > &  scissor  ) 

Returns True if Scissor test is enabled.

Parameters:
[out] scissor the current scissor test viewport.
bool ork::FrameBuffer::getScissorTest (  ) 

Returns True if Scissor test is enabled.

vec2<GLint> ork::FrameBuffer::getStencilMask (  ) 

Returns the stencil buffer writing mask.

bool ork::FrameBuffer::getStencilTest ( Function &  ff,
GLint &  fref,
GLint &  fmask,
StencilOperation &  ffail,
StencilOperation &  fdpfail,
StencilOperation &  fdppass,
Function &  bf,
GLint &  bref,
GLint &  bmask,
StencilOperation &  bfail,
StencilOperation &  bdpfail,
StencilOperation &  bdppass 
)

Returns true if stencil test is enabled.

Parameters:
[out] ff the current front face function.
[out] fref the current front face reference value.
[out] fmask the current front face stencil mask.
[out] ffail the current stencil operation used when failing stencil test on front faces.
[out] fdpfail the current stencil operation used when passing stencil test but failing depth test on front faces.
[out] fdppass the current stencil operation used when passing both stencil and depth tests on front faces.
[out] bf the current back face function.
[out] bref the current back face reference value.
[out] bmask the current back face stencil mask.
[out] bfail the current stencil operation used when failing stencil test on back faces.
[out] bdpfail the current stencil operation used when passing stencil test but failing depth test on back faces.
[out] bdppass the current stencil operation used when passing both stencil and depth tests on back faces.
bool ork::FrameBuffer::getStencilTest ( Function &  ff,
GLint &  fref,
GLint &  fmask,
StencilOperation &  ffail,
StencilOperation &  fdpfail,
StencilOperation &  fdppass 
)

Returns true if stencil test is enabled.

Parameters:
[out] ff the current front face function.
[out] fref the current front face reference value.
[out] fmask the current front face stencil mask.
[out] ffail the current stencil operation used when failing stencil test on front faces.
[out] fdpfail the current stencil operation used when passing stencil test but failing depth test on front faces.
[out] fdppass the current stencil operation used when passing both stencil and depth tests on front faces.
bool ork::FrameBuffer::getStencilTest (  ) 

Returns true if stencil test is enabled.

ptr<Texture> ork::FrameBuffer::getTextureBuffer ( BufferId  b  ) 

Returns the texture attached to the given attachment point.

Returns:
the texture attached to the given attachment point, or NULL if there is no texture bound to this attachment point (either because nothing is attached, or because a render buffer is attached).
vec4<GLint> ork::FrameBuffer::getViewport (  ) 

Returns this framebuffer's viewport.

void ork::FrameBuffer::multiDraw ( ptr< Program p,
const MeshBuffers mesh,
MeshMode  m,
GLint *  firsts,
GLsizei *  counts,
GLsizei  primCount,
GLint *  bases = 0 
)

Draws several parts of a mesh.

Each part is specified with a first and count parameter as in draw(). These values are passed in arrays of primCount values.

Parameters:
p the program to use to draw the mesh.
mesh the mesh to draw.
m how the mesh vertices must be interpreted.
firsts an array of primCount 'first vertex' to draw, or an array of 'first indice' to draw if this mesh has indices.
counts an array of number of vertices to draw, or an array of number of indices to draw if this mesh has indices.
primCount the number of parts of this mesh to draw.
bases the base vertices to use. Only used for meshes with indices.
void ork::FrameBuffer::readPixels ( int  x,
int  y,
int  w,
int  h,
TextureFormat  f,
PixelType  t,
const Buffer::Parameters s,
const Buffer dstBuf,
bool  clamp = false 
)

Reads pixels from the attached color buffers into the given buffer.

Parameters:
x lower left corner of the area where the pixels must be read.
y lower left corner of the area where the pixels must be read.
w width of the area where the pixels must be read.
h height of the area where the pixels must be read.
f the format of pixels to be stored in dstBuf.
t the type of pixel components in dstBuf.
s optional pixel storage parameters for dstBuf.
dstBuf destination buffer for the read pixels.
clamp true to clamp read colors to 0..1.
static void ork::FrameBuffer::resetAllStates (  )  [static]

Resets all the internal Ork specific state.

Call this method before and after using OpenGL API directly.

void ork::FrameBuffer::setBlend ( BufferId  buffer,
bool  enableBlend,
BlendEquation  rgb,
BlendArgument  srgb,
BlendArgument  drgb,
BlendEquation  alpha,
BlendArgument  salpha,
BlendArgument  dalpha 
)

Enables or disables blending for a given buffer.

Parameters:
buffer the buffer whose blending options must be changed.
enableBlend true to enable blending.
rgb the color blending equation.
srgb the source color blending argument.
drgb the destination color blending argument.
alpha the alpha blending equation.
salpha the source alpha blending argument.
dalpha the destination alpha blending argument.
void ork::FrameBuffer::setBlend ( bool  enableBlend,
BlendEquation  rgb,
BlendArgument  srgb,
BlendArgument  drgb,
BlendEquation  alpha,
BlendArgument  salpha,
BlendArgument  dalpha 
)

Enables or disables blending.

Parameters:
enableBlend true to enable blending.
rgb the color blending equation.
srgb the source color blending argument.
drgb the destination color blending argument.
alpha the alpha blending equation.
salpha the source alpha blending argument.
dalpha the destination alpha blending argument.
void ork::FrameBuffer::setBlend ( BufferId  buffer,
bool  enableBlend,
BlendEquation  e,
BlendArgument  src,
BlendArgument  dst 
)

Enables or disables blending for a given buffer.

Parameters:
buffer the buffer whose blending options must be changed.
enableBlend true to enable blending.
e the color and alpha blending equation.
src the source color and alpha blending argument.
dst the destination color and alpha blending argument.
void ork::FrameBuffer::setBlend ( bool  enableBlend,
BlendEquation  e,
BlendArgument  src,
BlendArgument  dst 
)

Enables or disables blending.

Parameters:
enableBlend true to enable blending.
e the color and alpha blending equation.
src the source color and alpha blending argument.
dst the destination color and alpha blending argument.
void ork::FrameBuffer::setBlend ( BufferId  buffer,
bool  enableBlend 
)

Enables or disables blending for a given buffer.

void ork::FrameBuffer::setBlend ( bool  enableBlend  ) 

Enables or disables blending.

void ork::FrameBuffer::setBlendColor ( const vec4< GLfloat > &  color  ) 

Sets Blend color parameter.

void ork::FrameBuffer::setClearColor ( const vec4< GLfloat > &  clearColor  ) 

Sets the color used to clear the current draw buffer.

void ork::FrameBuffer::setClearDepth ( GLfloat  clearDepth  ) 

Sets the depth used to clear the current depth buffer.

void ork::FrameBuffer::setClearStencil ( GLint  clearStencil  ) 

Sets the stencil used to clear the current stencil buffer.

void ork::FrameBuffer::setClipDistances ( int  clipDistances  ) 

Sets the clipping bit, used to determine which planes will be used for clipping.

void ork::FrameBuffer::setColorMask ( BufferId  buffer,
bool  r,
bool  g,
bool  b,
bool  a 
)

Sets color buffer's writing mask.

void ork::FrameBuffer::setColorMask ( bool  r,
bool  g,
bool  b,
bool  a 
)

Sets color buffer's writing mask.

void ork::FrameBuffer::setDepthMask ( bool  d  ) 

Sets depth buffer's writing mask.

void ork::FrameBuffer::setDepthRange ( GLfloat  n,
GLfloat  f 
)

Sets the depth range for this framebuffer (near and far planes).

Parameters:
n near plane.
f far plane.
void ork::FrameBuffer::setDepthTest ( bool  enableDepth,
Function  depth 
)

Enables or disables depth test.

void ork::FrameBuffer::setDepthTest ( bool  enableDepth  ) 

Enables or disables depth test.

void ork::FrameBuffer::setDither ( bool  enableDither  ) 

Enables or disables dithering.

void ork::FrameBuffer::setDrawBuffer ( BufferId  b  ) 

Sets the draw buffer for clear and draw methods.

Parameters:
b one of the color buffer.
void ork::FrameBuffer::setDrawBuffers ( BufferId  b  ) 

Sets the draw buffers for clear and draw methods.

Parameters:
b a set of color buffers (ORed with each other).
void ork::FrameBuffer::setFrontFaceCW ( bool  frontFaceCW  ) 

Determines the orientation of front faces.

Parameters:
frontFaceCW if true, clockwise faces will be front faces.
void ork::FrameBuffer::setLineSmooth ( bool  lineSmooth  ) 

Enables or disables the AA on line drawing.

void ork::FrameBuffer::setLineWidth ( GLfloat  lineWidth  ) 

Sets the line primitive's width.

void ork::FrameBuffer::setLogicOp ( bool  enableLogic,
LogicOperation  logicOp 
)

Enables or disables logical operation.

void ork::FrameBuffer::setLogicOp ( bool  enableLogic  ) 

Enables or disables logical operation.

void ork::FrameBuffer::setMultisample ( bool  multiSample  ) 

Enables or disables multisampling.

void ork::FrameBuffer::setOcclusionTest ( ptr< Query occlusionQuery,
QueryMode  occlusionMode 
)

Adds an occlusion query.

void ork::FrameBuffer::setParameters ( const Parameters p  ) 

Sets all the parameters of this framebuffer at once.

Parameters:
p a set of framebuffer parameters obtained via getParameters().
void ork::FrameBuffer::setPointFadeThresholdSize ( GLfloat  pointFadeThresholdSize  ) 

Sets the maximum size of a point.

void ork::FrameBuffer::setPointLowerLeftOrigin ( bool  pointLowerLeftOrigin  ) 

Sets the origin corner of a point.

void ork::FrameBuffer::setPointSize ( GLfloat  pointSize  ) 

Sets the point primitive's size.

void ork::FrameBuffer::setPolygonMode ( PolygonMode  polygonFront,
PolygonMode  polygonBack 
)

Sets the polygon mode for front and back faces.

Parameters:
polygonFront drawing mode for front faces.
polygonBack drawing mode for back faces.
void ork::FrameBuffer::setPolygonOffset ( bool  pointOffset,
bool  lineOffset,
bool  polygonOffset 
)

Determines which primitives should be offset.

void ork::FrameBuffer::setPolygonOffset ( GLfloat  factor,
GLfloat  units 
)

Sets the factor and units when using offsets on primitives.

void ork::FrameBuffer::setPolygonSmooth ( bool  polygonSmooth  ) 

Enables or disables AA on polygon drawing.

void ork::FrameBuffer::setReadBuffer ( BufferId  b  ) 

Sets the read buffer for readPixels and copyPixels methods.

Parameters:
b one of the color buffer.
void ork::FrameBuffer::setRenderBuffer ( BufferId  b,
const ptr< RenderBuffer t 
)

Sets an attachment of this framebuffer using a render buffer.

Parameters:
b an attachment point.
t the render buffer to be bound to this attachment point.
void ork::FrameBuffer::setSampleAlpha ( bool  sampleAlphaToCoverage,
bool  sampleAlphaToOne 
)

Sets sampling filter options.

void ork::FrameBuffer::setSampleCoverage ( GLfloat  sampleCoverage  ) 

Sets sampling coverage.

void ork::FrameBuffer::setSampleMask ( GLbitfield  sampleMask  ) 

Sets sampling mask.

void ork::FrameBuffer::setSampleShading ( bool  sampleShading,
GLfloat  minSamples 
)

Enables or disables AA on multisampling.

void ork::FrameBuffer::setScissorTest ( bool  enableScissor,
const vec4< GLint > &  scissor 
)

Enables or disables scissor test.

void ork::FrameBuffer::setScissorTest ( bool  enableScissor  ) 

Enables or disables scissor test.

void ork::FrameBuffer::setStencilMask ( GLuint  frontMask,
GLuint  backMask 
)

Sets stencil buffer's writing mask.

void ork::FrameBuffer::setStencilTest ( bool  enableStencil,
Function  ff,
GLint  fref,
GLuint  fmask,
StencilOperation  ffail,
StencilOperation  fdpfail,
StencilOperation  fdppass,
Function  bf,
GLint  bref,
GLuint  bmask,
StencilOperation  bfail,
StencilOperation  bdpfail,
StencilOperation  bdppass 
)

Enables or disables stencil test.

Parameters:
enableStencil true to enable the stencil test.
ff the front face function.
fref the front face reference value.
fmask the front face stencil mask.
ffail the stencil operation used when failing stencil test on front faces.
fdpfail the stencil operation used when passing stencil test but failing depth test on front faces.
fdppass the stencil operation used when passing both stencil and depth tests on front faces.
bf the back face function.
bref the back face reference value.
bmask the back face stencil mask.
bfail the stencil operation used when failing stencil test on back faces.
bdpfail the stencil operation used when passing stencil test but failing depth test on back faces.
bdppass the stencil operation used when passing both stencil and depth tests on back faces.
void ork::FrameBuffer::setStencilTest ( bool  enableStencil,
Function  f,
GLint  ref,
GLuint  mask,
StencilOperation  sfail,
StencilOperation  dpfail,
StencilOperation  dppass 
)

Enables or disables stencil test.

Parameters:
enableStencil true to enable the stencil test.
f the front and back face function.
ref the front and back face reference value.
mask the front and back face stencil mask.
sfail the stencil operation used when failing stencil test on front or back faces.
dpfail the stencil operation used when passing stencil test but failing depth test on front or back faces.
dppass the stencil operation used when passing both stencil and depth tests on front or back faces.
void ork::FrameBuffer::setStencilTest ( bool  enableStencil  ) 

Enables or disables stencil test.

Parameters:
enableStencil true to enable the stencil test.
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< TextureCubeArray t,
int  level,
CubeFace  cf 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
cf the cube face to be attached (all the layers for this face will be attached at once).
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< TextureCube t,
int  level,
CubeFace  cf 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
cf the cube face to be attached (-1 to attach all the faces).
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< Texture3D t,
int  level,
int  layer 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
layer the z slice to be attached (-1 to attach all the slices).
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< Texture2DMultisampleArray t,
int  layer 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
layer the layer to be attached (-1 to attach all layers).
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< Texture2DArray t,
int  level,
int  layer 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
layer the layer to be attached (-1 to attach all layers).
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< Texture2DMultisample t 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< TextureRectangle t,
int  level 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< Texture2D t,
int  level 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< Texture1DArray t,
int  level,
int  layer 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
layer the layer to be attached (-1 to attach all layers).
void ork::FrameBuffer::setTextureBuffer ( BufferId  b,
const ptr< Texture1D t,
int  level 
)

Sets an attachment of this framebuffer using a texture.

Parameters:
b an attachment point.
t the texture to be bound to this attachment point.
level the LOD level to be attached.
void ork::FrameBuffer::setViewport ( const vec4< GLint > &  viewport  ) 

Sets the viewport for this framebuffer (up, down, left and right planes).

Parameters:
viewport the new viewport.

Generated on Mon Oct 18 09:36:08 2010 for ork by  doxygen 1.6.1