132 #ifndef vtkOpenGLFramebufferObject_h
133 #define vtkOpenGLFramebufferObject_h
142 #define VTK_UPDATED_FRAMEBUFFER
151 #define vtkCheckFrameBufferStatusMacro(mode)
152 #define vtkStaticCheckFrameBufferStatusMacro(mode)
154 #define vtkCheckFrameBufferStatusMacroImpl(macro, mode) \
157 bool ok = vtkOpenGLFramebufferObject::GetFrameBufferStatus(mode, eStr); \
160 macro(<< "OpenGL ERROR. The FBO is incomplete : " << eStr); \
163 #define vtkCheckFrameBufferStatusMacro(mode) vtkCheckFrameBufferStatusMacroImpl(vtkErrorMacro, mode)
164 #define vtkStaticCheckFrameBufferStatusMacro(mode) \
165 vtkCheckFrameBufferStatusMacroImpl(vtkGenericWarningMacro, mode)
169 #include "vtkRenderingOpenGL2Module.h"
207 void Bind(
unsigned int mode);
213 void UnBind(
unsigned int mode);
219 void SaveCurrentBindingsAndBuffers();
220 void SaveCurrentBindingsAndBuffers(
unsigned int mode);
221 void RestorePreviousBindingsAndBuffers();
222 void RestorePreviousBindingsAndBuffers(
unsigned int mode);
235 bool Start(
int width,
int height);
236 bool StartNonOrtho(
int width,
int height);
243 void InitializeViewport(
int width,
int height);
247 void ActivateDrawBuffers(
unsigned int n);
248 void ActivateDrawBuffers(
unsigned int* ids,
int n);
249 void ActivateDrawBuffer(
unsigned int id);
250 void ActivateReadBuffer(
unsigned int id);
253 this->ActivateDrawBuffer(
id);
254 this->ActivateReadBuffer(
id);
256 void DeactivateDrawBuffers();
257 void DeactivateReadBuffer();
260 vtkGetMacro(ActiveReadBuffer,
unsigned int);
261 unsigned int GetActiveDrawBuffer(
unsigned int id);
273 void RenderQuad(
int minX,
int maxX,
int minY,
int maxY,
vtkShaderProgram* program,
280 void AddColorAttachment(
unsigned int attId,
vtkTextureObject* tex,
unsigned int zslice = 0,
281 unsigned int format = 0,
unsigned int mipmapLevel = 0);
283 void RemoveColorAttachment(
unsigned int index);
284 void RemoveColorAttachments(
unsigned int num);
296 int GetNumberOfColorAttachments();
302 void AddDepthAttachment();
305 void RemoveDepthAttachment();
315 bool PopulateFramebuffer(
int width,
int height);
316 bool PopulateFramebuffer(
int width,
int height,
bool useTextures,
int numberOfColorAttachments,
317 int colorDataType,
bool wantDepthAttachment,
int depthBitplanes,
int multisamples,
318 bool wantStencilAttachment =
false);
326 unsigned int GetMaximumNumberOfActiveTargets();
333 unsigned int GetMaximumNumberOfRenderTargets();
341 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize pointer "
343 return this->LastSize;
347 _arg1 = this->LastSize[0];
348 _arg2 = this->LastSize[1];
349 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize (" << _arg1
350 <<
"," << _arg2 <<
")");
365 int CheckFrameBufferStatus(
unsigned int mode);
370 virtual void ReleaseGraphicsResources(
vtkWindow* win);
378 static bool GetFrameBufferStatus(
unsigned int mode,
const char*& desc);
380 vtkGetMacro(FBOIndex,
unsigned int);
389 const int srcExt[4],
const int destExt[4],
unsigned int bits,
unsigned int mapping);
420 int extent[4],
int vtkType,
int nComps,
int oglType,
int oglFormat);
422 static void Download(
428 static unsigned int GetDrawMode();
429 static unsigned int GetReadMode();
430 static unsigned int GetBothMode();
435 void Resize(
int width,
int height);
437 int GetMultiSamples();
443 void AttachColorBuffer(
unsigned int index);
444 void AttachDepthBuffer();
461 void DestroyColorBuffers(
vtkWindow* win);
464 void ActivateBuffers();
472 void DisplayFrameBufferAttachments();
477 void DisplayFrameBufferAttachment(
unsigned int uattachment);
482 void DisplayDrawBuffers();
487 void DisplayReadBuffer();
492 void DisplayBuffer(
int value);
497 int GetOpenGLType(
int vtkType);
static bool IsSupported(vtkOpenGLRenderWindow *)
Returns if the context supports the required extensions.
vtkGenericOpenGLResourceFreeCallback * ResourceCallback
static bool LoadRequiredExtensions(vtkOpenGLRenderWindow *)
Load all necessary extensions.
void GetLastSize(int &_arg1, int &_arg2) override
Dimensions in pixels of the framebuffer.
std::map< unsigned int, vtkFOInfo * > ColorBuffers
window superclass for vtkRenderWindow
abstract interface to OpenGL FBOs
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkOpenGLRenderWindow * Context
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
const char * GetClassName() const
Return the class name as a string.
std::vector< unsigned int > ActiveBuffers
abstracts an OpenGL pixel buffer object.
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
unsigned int ActiveReadBuffer
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
void ActivateBuffer(unsigned int id)
int * GetLastSize() override
Dimensions in pixels of the framebuffer.
The ShaderProgram uses one or more Shader objects.