Go to the documentation of this file.
29 #ifndef vtkFrameBufferObject_h
30 #define vtkFrameBufferObject_h
33 #include "vtkRenderingOpenGL2Module.h"
77 bool Start(
int width,
int height,
bool shaderSupportsTextureInt);
110 this->SetActiveBuffers(1, &
index);
136 unsigned int zslice=0);
156 vtkGetMacro(DepthBufferNeeded,
bool);
168 vtkGetMacro(NumberOfRenderTargets,
unsigned int);
189 vtkGetVector2Macro(LastSize,
int);
237 bool shaderSupportsTextureInt);
276 bool DepthBufferNeeded;
277 bool ColorBuffersDirty;
278 unsigned int FBOIndex;
279 int PreviousFBOIndex;
280 unsigned int DepthBuffer;
281 unsigned int NumberOfRenderTargets;
283 std::vector<unsigned int> UserZSlices;
284 std::vector<vtkSmartPointer<vtkTextureObject> > UserColorBuffers;
285 std::vector<vtkSmartPointer<vtkTextureObject> > ColorBuffers;
286 std::vector<unsigned int> ActiveBuffers;
288 bool DepthBufferDirty;
internal class which encapsulates OpenGL frame buffer object.
void SetActiveBuffers(int numbuffers, unsigned int indices[])
User provided color buffers are attached by index to color buffers.
void DestroyColorBuffers()
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
void RenderQuad(int minX, int maxX, int minY, int maxY, vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
Renders a quad at the given location with pixel coordinates.
void DisplayBuffer(int value)
Display any buffer (convert value into string).
void CreateDepthBuffer(int width, int height, unsigned int mode)
int CheckFrameBufferStatus(unsigned int mode)
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkError...
void SetActiveBuffer(unsigned int index)
Choose the buffers to render into.
void DisplayReadBuffer()
Display the read buffer.
void UnBind()
Restore the previous draw framebuffer if saved, else bind the default buffer.
void RemoveColorBuffer(unsigned int index)
abstract interface to OpenGL FBOs
window superclass for vtkRenderWindow
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
static bool IsSupported(vtkOpenGLRenderWindow *renWin)
Returns if the context supports the required extensions.
bool StartNonOrtho(int width, int height, bool shaderSupportsTextureInt)
void DisplayFrameBufferAttachment(unsigned int uattachment)
Display a given attachment for the current framebuffer object.
void Bind()
Make the draw frame buffer active (uses FRAMEBUFFER).
bool Start(int width, int height, bool shaderSupportsTextureInt)
User must take care that width/height match the dimensions of the user defined texture attachments.
The ShaderProgram uses one or more Shader objects.
void DisplayFrameBufferAttachments()
Display all the attachments of the current framebuffer object.
a simple class to control print indentation
abstracts an OpenGL texture object.
void SetColorBuffer(unsigned int index, vtkTextureObject *texture, unsigned int zslice=0)
Insert a color buffer into the list of available color buffers.
void DestroyDepthBuffer()
vtkOpenGLRenderWindow * GetContext()
static bool LoadRequiredExtensions(vtkOpenGLRenderWindow *renWin)
Load all necessary extensions.
unsigned int GetMaximumNumberOfRenderTargets()
Returns the maximum number of render targets available.
vtkTextureObject * GetColorBuffer(unsigned int index)
void RemoveAllColorBuffers()
void DisplayDrawBuffers()
Display the draw buffers.
unsigned int GetMaximumNumberOfActiveTargets()
Returns the maximum number of targets that can be rendered to at one time.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkWeakPointer< vtkOpenGLRenderWindow > Context
virtual void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind.
void SetNumberOfRenderTargets(unsigned int)
Set/Get the number of render targets to render into at once.
static vtkFrameBufferObject * New()
void SetDepthBuffer(vtkTextureObject *depthTexture)
Set the texture to use as depth buffer.
void CreateColorBuffers(int width, int height, unsigned int mode, bool shaderSupportsTextureInt)
create a window for renderers to draw into
void SetContext(vtkOpenGLRenderWindow *context)
Get/Set the context.
The VertexArrayObject class uses, or emulates, vertex array objects.
abstracts an OpenGL pixel buffer object.