135 #ifndef vtkOpenGLFramebufferObject_h 136 #define vtkOpenGLFramebufferObject_h 145 # define vtkCheckFrameBufferStatusMacro(mode) 146 # define vtkStaticCheckFrameBufferStatusMacro(mode) 148 # define vtkCheckFrameBufferStatusMacroImpl(macro, mode) \ 151 bool ok = vtkOpenGLFramebufferObject::GetFrameBufferStatus(mode, eStr); \ 155 << "OpenGL ERROR. The FBO is incomplete : " << eStr); \ 158 # define vtkCheckFrameBufferStatusMacro(mode) \ 159 vtkCheckFrameBufferStatusMacroImpl(vtkErrorMacro, mode) 160 # define vtkStaticCheckFrameBufferStatusMacro(mode) \ 161 vtkCheckFrameBufferStatusMacroImpl(vtkGenericWarningMacro, mode) 166 #include "vtkRenderingOpenGL2Module.h" 205 void Bind(
unsigned int mode);
211 void UnBind(
unsigned int mode);
217 void SaveCurrentBindings();
218 void SaveCurrentBindings(
unsigned int mode);
220 this->SaveCurrentBuffers();
221 this->SaveCurrentBindings();
224 this->SaveCurrentBuffers(mode);
225 this->SaveCurrentBindings(mode);
227 void RestorePreviousBindings();
228 void RestorePreviousBindings(
unsigned int mode);
230 this->RestorePreviousBindings();
231 this->RestorePreviousBuffers();
234 this->RestorePreviousBindings(mode);
235 this->RestorePreviousBuffers(mode);
247 void SaveCurrentBuffers();
248 void SaveCurrentBuffers(
unsigned int mode);
249 void RestorePreviousBuffers();
250 void RestorePreviousBuffers(
unsigned int mode);
263 bool Start(
int width,
int height);
264 bool StartNonOrtho(
int width,
int height);
271 void InitializeViewport(
int width,
int height);
275 void ActivateDrawBuffers(
unsigned int n);
276 void ActivateDrawBuffers(
unsigned int *ids,
int n);
277 void ActivateDrawBuffer(
unsigned int id);
278 void ActivateReadBuffer(
unsigned int id);
280 this->ActivateDrawBuffer(
id);
281 this->ActivateReadBuffer(
id); }
282 void DeactivateDrawBuffers();
283 void DeactivateReadBuffer();
296 void RenderQuad(
int minX,
int maxX,
int minY,
int maxY,
305 void AddColorAttachment(
309 unsigned int zslice = 0,
310 unsigned int format = 0,
311 unsigned int mipmapLevel = 0);
312 void AddColorAttachment(
316 void RemoveColorAttachment(
unsigned int mode,
unsigned int index);
317 void RemoveColorAttachments(
unsigned int mode,
unsigned int num);
323 int GetNumberOfColorAttachments(
unsigned int mode);
330 this->AddDepthAttachment(this->GetBothMode()); }
331 void AddDepthAttachment(
unsigned int mode);
334 void RemoveDepthAttachment(
unsigned int mode);
343 bool PopulateFramebuffer(
int width,
int height);
344 bool PopulateFramebuffer(
348 int numberOfColorAttachments,
350 bool wantDepthAttachment,
360 unsigned int GetMaximumNumberOfActiveTargets();
367 unsigned int GetMaximumNumberOfRenderTargets();
375 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize pointer " << this->LastSize);
376 return this->LastSize;
380 _arg1 = this->LastSize[0];
381 _arg2 = this->LastSize[1];
382 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize (" << _arg1 <<
"," << _arg2 <<
")");
401 int CheckFrameBufferStatus(
unsigned int mode);
406 virtual void ReleaseGraphicsResources(
vtkWindow *win);
415 bool GetFrameBufferStatus(
426 const int srcExt[4],
const int destExt[4],
unsigned int bits,
unsigned int mapping);
484 static unsigned int GetDrawMode();
485 static unsigned int GetReadMode();
486 static unsigned int GetBothMode();
491 void Resize(
int width,
int height);
495 { this->RemoveColorAttachments(mode, num); }
497 { this->RemoveColorAttachment(mode, attId); }
499 { this->RemoveDepthAttachment(mode); }
501 { this->RemoveDepthAttachment(mode); }
504 void SetColorBuffer(
unsigned int mode,
506 unsigned int zslice=0,
unsigned int format=0,
unsigned int mipmapLevel=0);
507 void SetColorBuffer(
unsigned int mode,
520 void AttachColorBuffer(
unsigned int mode,
unsigned int index);
521 void AttachDepthBuffer(
unsigned int mode);
540 void DestroyColorBuffers(
vtkWindow *win);
543 void ActivateBuffers();
551 void DisplayFrameBufferAttachments();
556 void DisplayFrameBufferAttachment(
unsigned int uattachment);
561 void DisplayDrawBuffers();
566 void DisplayReadBuffer();
571 void DisplayBuffer(
int value);
576 int GetOpenGLType(
int vtkType);
static bool IsSupported(vtkOpenGLRenderWindow *)
Returns if the context supports the required extensions.
void AddDepthAttachment()
Directly assign/remove a texture/renderbuffer to depth attachments.
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
virtual int * GetLastSize()=0
Dimensions in pixels of the framebuffer.
void RemoveRenDepthAttachment(unsigned int mode)
unsigned int PreviousDrawFBO
void RemoveTexColorAttachment(unsigned int mode, unsigned int attId)
static bool LoadRequiredExtensions(vtkOpenGLRenderWindow *)
Load all necessary extensions.
std::map< unsigned int, vtkFOInfo * > ReadColorBuffers
vtkWeakPointer< vtkOpenGLRenderWindow > Context
vtkFOInfo * DrawDepthBuffer
std::map< unsigned int, vtkFOInfo * > DrawColorBuffers
void GetLastSize(int &_arg1, int &_arg2) override
Dimensions in pixels of the framebuffer.
unsigned int PreviousReadBuffer
void SaveCurrentBindingsAndBuffers(unsigned int mode)
Store/Restore the current framebuffer bindings and buffers.
window superclass for vtkRenderWindow
void RemoveTexDepthAttachment(unsigned int mode)
vtkFOInfo * ReadDepthBuffer
abstract interface to OpenGL FBOs
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
void RestorePreviousBindingsAndBuffers()
Store/Restore the current framebuffer bindings and buffers.
The VertexArrayObject class uses, or emulates, vertex array objects.
const char * GetClassName() const
Return the class name as a string.
void RestorePreviousBindingsAndBuffers(unsigned int mode)
Store/Restore the current framebuffer bindings and buffers.
std::vector< unsigned int > ActiveBuffers
abstracts an OpenGL pixel buffer object.
unsigned int PreviousReadFBO
Internal class which encapsulates OpenGL FramebufferObject.
void GetLastSize(int _arg[2]) override
Dimensions in pixels of the framebuffer.
abstracts an OpenGL texture object.
create a window for renderers to draw into
void RemoveTexColorAttachments(unsigned int mode, unsigned int num)
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void SaveCurrentBindingsAndBuffers()
Store/Restore the current framebuffer bindings and buffers.
void ActivateBuffer(unsigned int id)
int * GetLastSize() override
Dimensions in pixels of the framebuffer.
unsigned int PreviousDrawBuffer
The ShaderProgram uses one or more Shader objects.