 |
VTK
9.0.1
|
Go to the documentation of this file.
129 #ifndef vtkOpenGLFramebufferObject_h
130 #define vtkOpenGLFramebufferObject_h
139 #define VTK_UPDATED_FRAMEBUFFER
148 #define vtkCheckFrameBufferStatusMacro(mode)
149 #define vtkStaticCheckFrameBufferStatusMacro(mode)
151 #define vtkCheckFrameBufferStatusMacroImpl(macro, mode) \
154 bool ok = vtkOpenGLFramebufferObject::GetFrameBufferStatus(mode, eStr); \
157 macro(<< "OpenGL ERROR. The FBO is incomplete : " << eStr); \
160 #define vtkCheckFrameBufferStatusMacro(mode) vtkCheckFrameBufferStatusMacroImpl(vtkErrorMacro, mode)
161 #define vtkStaticCheckFrameBufferStatusMacro(mode) \
162 vtkCheckFrameBufferStatusMacroImpl(vtkGenericWarningMacro, mode)
166 #include "vtkRenderingOpenGL2Module.h"
250 this->ActivateDrawBuffer(
id);
251 this->ActivateReadBuffer(
id);
257 vtkGetMacro(ActiveReadBuffer,
unsigned int);
278 unsigned int format = 0,
unsigned int mipmapLevel = 0);
307 int colorDataType,
bool wantDepthAttachment,
int depthBitplanes,
int multisamples,
308 bool wantStencilAttachment =
false);
331 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize pointer "
333 return this->LastSize;
337 _arg1 = this->LastSize[0];
338 _arg2 = this->LastSize[1];
339 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize (" << _arg1
340 <<
"," << _arg2 <<
")");
370 vtkGetMacro(FBOIndex,
unsigned int);
379 const int srcExt[4],
const int destExt[4],
unsigned int bits,
unsigned int mapping);
410 int extent[4],
int vtkType,
int nComps,
int oglType,
int oglFormat);
int * GetLastSize() override
Dimensions in pixels of the framebuffer.
static unsigned int GetDrawMode()
void DisplayReadBuffer()
Display the read buffer.
void UnBind(unsigned int mode)
void SaveCurrentBindingsAndBuffers(unsigned int mode)
void DeactivateDrawBuffers()
void RestorePreviousBindingsAndBuffers()
bool StartNonOrtho(int width, int height)
vtkOpenGLFramebufferObject()
bool PopulateFramebuffer(int width, int height)
Convenience method to populate a framebuffer with attachments created as well.
void AddDepthAttachment(vtkTextureObject *tex)
Internal class which encapsulates OpenGL FramebufferObject.
void RemoveDepthAttachment()
unsigned int GetMaximumNumberOfRenderTargets()
Returns the maximum number of render targets available.
void GetLastSize(int _arg[2]) override
void ActivateReadBuffer(unsigned int id)
unsigned int GetActiveDrawBuffer(unsigned int id)
vtkPixelBufferObject * DownloadColor3(int extent[4], int vtkType)
void DisplayDrawBuffers()
Display the draw buffers.
vtkPixelBufferObject * DownloadDepth(int extent[4], int vtkType)
Download data from the depth attachment of the currently bound FBO.
int GetNumberOfColorAttachments()
Return the number of color attachments for the given mode.
static bool LoadRequiredExtensions(vtkOpenGLRenderWindow *)
Load all necessary extensions.
vtkPixelBufferObject * DownloadColor4(int extent[4], int vtkType)
abstract interface to OpenGL FBOs
window superclass for vtkRenderWindow
void ActivateDrawBuffers(unsigned int n)
bool Start(int width, int height)
User must take care that width/height match the dimensions of the user defined texture attachments.
vtkOpenGLRenderWindow * GetContext()
void DisplayBuffer(int value)
Display any buffer (convert value into string).
void ActivateDrawBuffers(unsigned int *ids, int n)
const char * GetClassName() const
Return the class name as a string.
vtkPixelBufferObject * Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat)
Download data from the read buffer of the current FBO.
static vtkOpenGLFramebufferObject * New()
void RemoveColorAttachment(unsigned int index)
int CheckFrameBufferStatus(unsigned int mode)
Validate the current FBO configuration (attachments, formats, etc) prints detected errors to vtkError...
void InitializeViewport(int width, int height)
Set up ortho viewport with scissor, lighting, blend, and depth disabled.
The ShaderProgram uses one or more Shader objects.
void Resize(int width, int height)
Resize all FO attachments.
void DestroyDepthBuffer(vtkWindow *win)
a simple class to control print indentation
abstracts an OpenGL texture object.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static bool IsSupported(vtkOpenGLRenderWindow *)
Returns if the context supports the required extensions.
void Bind()
Make the draw frame buffer active.
void DeactivateReadBuffer()
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
unsigned int ActiveReadBuffer
static int Blit(const int srcExt[4], const int destExt[4], unsigned int bits, unsigned int mapping)
Copy from the currently bound READ FBO to the currently bound DRAW FBO.
void AttachColorBuffer(unsigned int index)
Attach a specific buffer.
int GetOpenGLType(int vtkType)
Given a vtk type get a compatible open gl type.
bool PopulateFramebuffer(int width, int height, bool useTextures, int numberOfColorAttachments, int colorDataType, bool wantDepthAttachment, int depthBitplanes, int multisamples, bool wantStencilAttachment=false)
void AddDepthAttachment()
Directly assign/remove a texture/renderbuffer to depth attachments.
void DisplayFrameBufferAttachment(unsigned int uattachment)
Display a given attachment for the current framebuffer object.
void AddDepthAttachment(vtkRenderbuffer *tex)
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 DestroyColorBuffers(vtkWindow *win)
void SetContext(vtkRenderWindow *context)
Get/Set the context.
~vtkOpenGLFramebufferObject() override
void RemoveColorAttachments(unsigned int num)
static void Download(int extent[4], int vtkType, int nComps, int oglType, int oglFormat, vtkPixelBufferObject *pbo)
void Bind(unsigned int mode)
void RestorePreviousBindingsAndBuffers(unsigned int mode)
std::map< unsigned int, vtkFOInfo * > ColorBuffers
static unsigned int GetBothMode()
vtkPixelBufferObject * DownloadColor1(int extent[4], int vtkType, int channel)
Download data from the read color attachment of the currently bound FBO into the returned PBO.
virtual void ReleaseGraphicsResources(vtkWindow *win)
Deactivate and UnBind.
void AddColorAttachment(unsigned int attId, vtkRenderbuffer *tex)
void AddColorAttachment(unsigned int attId, vtkTextureObject *tex, unsigned int zslice=0, unsigned int format=0, unsigned int mipmapLevel=0)
Directly assign/remove a texture to color attachments.
create a window for renderers to draw into
void GetLastSize(int &_arg1, int &_arg2) override
std::vector< unsigned int > ActiveBuffers
static bool GetFrameBufferStatus(unsigned int mode, const char *&desc)
Validate the current FBO configuration (attachments, formats, etc) return false if the FBO is incompl...
void UnBind()
Unbind this buffer.
unsigned int GetMaximumNumberOfActiveTargets()
Returns the maximum number of targets that can be rendered to at one time.
void SaveCurrentBindingsAndBuffers()
Store/Restore the current framebuffer bindings and buffers.
void DisplayFrameBufferAttachments()
Display all the attachments of the current framebuffer object.
The VertexArrayObject class uses, or emulates, vertex array objects.
void ActivateDrawBuffer(unsigned int id)
static unsigned int GetReadMode()
abstracts an OpenGL pixel buffer object.
void ActivateBuffer(unsigned int id)
vtkOpenGLRenderWindow * Context