120 #ifndef vtkOpenGLFramebufferObject_h
121 #define vtkOpenGLFramebufferObject_h
130 #define VTK_UPDATED_FRAMEBUFFER
139 #define vtkCheckFrameBufferStatusMacro(mode)
140 #define vtkStaticCheckFrameBufferStatusMacro(mode)
142 #define vtkCheckFrameBufferStatusMacroImpl(macro, mode) \
145 bool ok = vtkOpenGLFramebufferObject::GetFrameBufferStatus(mode, eStr); \
148 macro(<< "OpenGL ERROR. The FBO is incomplete : " << eStr); \
151 #define vtkCheckFrameBufferStatusMacro(mode) vtkCheckFrameBufferStatusMacroImpl(vtkErrorMacro, mode)
152 #define vtkStaticCheckFrameBufferStatusMacro(mode) \
153 vtkCheckFrameBufferStatusMacroImpl(vtkGenericWarningMacro, mode)
157 #include "vtkRenderingOpenGL2Module.h"
161 VTK_ABI_NAMESPACE_BEGIN
196 void Bind(
unsigned int mode);
202 void UnBind(
unsigned int mode);
208 void SaveCurrentBindingsAndBuffers();
209 void SaveCurrentBindingsAndBuffers(
unsigned int mode);
210 void RestorePreviousBindingsAndBuffers();
211 void RestorePreviousBindingsAndBuffers(
unsigned int mode);
224 bool Start(
int width,
int height);
225 bool StartNonOrtho(
int width,
int height);
232 void InitializeViewport(
int width,
int height);
236 void ActivateDrawBuffers(
unsigned int n);
237 void ActivateDrawBuffers(
unsigned int* ids,
int n);
238 void ActivateDrawBuffer(
unsigned int id);
239 void ActivateReadBuffer(
unsigned int id);
242 this->ActivateDrawBuffer(
id);
243 this->ActivateReadBuffer(
id);
245 void DeactivateDrawBuffers();
246 void DeactivateReadBuffer();
249 vtkGetMacro(ActiveReadBuffer,
unsigned int);
250 unsigned int GetActiveDrawBuffer(
unsigned int id);
262 void RenderQuad(
int minX,
int maxX,
int minY,
int maxY,
vtkShaderProgram* program,
269 void AddColorAttachment(
unsigned int attId,
vtkTextureObject* tex,
unsigned int zslice = 0,
270 unsigned int format = 0,
unsigned int mipmapLevel = 0);
272 void RemoveColorAttachment(
unsigned int index);
273 void RemoveColorAttachments(
unsigned int num);
285 int GetNumberOfColorAttachments();
291 void AddDepthAttachment();
294 void RemoveDepthAttachment();
304 bool PopulateFramebuffer(
int width,
int height);
305 bool PopulateFramebuffer(
int width,
int height,
bool useTextures,
int numberOfColorAttachments,
306 int colorDataType,
bool wantDepthAttachment,
int depthBitplanes,
int multisamples,
307 bool wantStencilAttachment =
false);
315 unsigned int GetMaximumNumberOfActiveTargets();
322 unsigned int GetMaximumNumberOfRenderTargets();
330 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize pointer "
332 return this->LastSize;
336 _arg1 = this->LastSize[0];
337 _arg2 = this->LastSize[1];
338 vtkDebugMacro(<< this->
GetClassName() <<
" (" <<
this <<
"): returning LastSize (" << _arg1
339 <<
"," << _arg2 <<
")");
354 int CheckFrameBufferStatus(
unsigned int mode);
359 virtual void ReleaseGraphicsResources(
vtkWindow* win);
367 static bool GetFrameBufferStatus(
unsigned int mode,
const char*& desc);
369 vtkGetMacro(FBOIndex,
unsigned int);
378 const int srcExt[4],
const int destExt[4],
unsigned int bits,
unsigned int mapping);
409 int extent[4],
int vtkType,
int nComps,
int oglType,
int oglFormat);
411 static void Download(
417 static unsigned int GetDrawMode();
418 static unsigned int GetReadMode();
419 static unsigned int GetBothMode();
424 void Resize(
int width,
int height);
426 int GetMultiSamples();
432 void AttachColorBuffer(
unsigned int index);
433 void AttachDepthBuffer();
450 void DestroyColorBuffers(
vtkWindow* win);
453 void ActivateBuffers();
461 void DisplayFrameBufferAttachments();
466 void DisplayFrameBufferAttachment(
unsigned int uattachment);
471 void DisplayDrawBuffers();
476 void DisplayReadBuffer();
481 void DisplayBuffer(
int value);
486 int GetOpenGLType(
int vtkType);
512 VTK_ABI_NAMESPACE_END
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.