16 #ifndef vtkOpenGLRenderWindow_h
17 #define vtkOpenGLRenderWindow_h
21 #include "vtkRenderingOpenGL2Module.h"
27 VTK_ABI_NAMESPACE_BEGIN
31 class vtkOpenGLHardwareSupport;
52 void Start()
override;
58 void Frame()
override;
69 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
70 static int GetGlobalMaximumNumberOfMultiSamples();
79 unsigned char*
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
override;
83 int x,
int y,
int x2,
int y2,
unsigned char*
data,
int front,
int right)
override;
92 float*
GetRGBAPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
94 int x,
int y,
int x2,
int y2,
int front,
vtkFloatArray*
data,
int right = 0)
override;
96 int x,
int y,
int x2,
int y2,
float*
data,
int front,
int blend = 0,
int right = 0)
override;
98 int right = 0)
override;
101 int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
105 int blend = 0,
int right = 0)
override;
107 int blend = 0,
int right = 0)
override;
115 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z)
override;
117 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* buffer)
override;
144 bool GetUsingSRGBColorSpace();
157 int GetColorBufferInternalFormat(
int attachmentPoint);
162 virtual void OpenGLInit();
165 virtual void OpenGLInitState();
168 virtual void OpenGLInitContext();
175 void GetOpenGLVersion(
int& major,
int& minor);
219 virtual void DrawPixels(
220 int x1,
int y1,
int x2,
int y2,
int numComponents,
int dataType,
void*
data);
226 virtual void DrawPixels(
int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
int srcXmin,
227 int srcYmin,
int srcXmax,
int srcYmax,
int srcWidth,
int srcHeight,
int numComponents,
228 int dataType,
void*
data);
234 virtual void DrawPixels(
int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void*
data);
254 int GetDefaultTextureInternalFormat(
255 int vtktype,
int numComponents,
bool needInteger,
bool needFloat,
bool needSRGB);
282 std::set<vtkGenericOpenGLResourceFreeCallback*>
Resources;
286 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
287 if (it == this->Resources.end())
289 this->Resources.insert(cb);
295 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
296 if (it != this->Resources.end())
298 this->Resources.erase(it);
344 int GetNoiseTextureUnit();
363 bool GetBufferNeedsResolving();
374 void BlitDisplayFramebuffer();
379 void BlitDisplayFramebuffer(
int right,
int srcX,
int srcY,
int srcWidth,
int srcHeight,
int destX,
380 int destY,
int destWidth,
int destHeight,
int bufferMode,
int interpolation);
387 void BlitToRenderFramebuffer(
bool includeDepth);
388 void BlitToRenderFramebuffer(
int srcX,
int srcY,
int srcWidth,
int srcHeight,
int destX,
389 int destY,
int destWidth,
int destHeight,
int bufferMode,
int interpolation);
427 vtkSetClampMacro(FrameBlitMode, FrameBlitModes, BlitToHardware, NoBlit);
428 vtkGetMacro(FrameBlitMode, FrameBlitModes);
438 vtkSetMacro(FramebufferFlipY,
bool);
439 vtkGetMacro(FramebufferFlipY,
bool);
440 vtkBooleanMacro(FramebufferFlipY,
bool);
457 int destX,
int destY,
int destX2,
int destY2);
465 virtual void BlitDisplayFramebuffersToHardware();
489 virtual bool ResolveFlipRenderFramebuffer();
498 bool ReadDepthComponent(
int depthSize);
506 virtual int ReadPixels(
507 const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right = 0);
517 int CreateFramebuffers(
int width,
int height);
532 virtual void CreateAWindow() = 0;
537 virtual void DestroyWindow() = 0;
547 void RestoreGLState();
589 VTK_ABI_NAMESPACE_END
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
vtkOpenGLFramebufferObject * ResolveFramebuffer
virtual void Start()
Start the rendering process for a frame.
std::string OpenGLSupportMessage
vtkTypeBool OwnContext
Flag telling if the context has been created here or was inherited.
virtual int GetDepthBufferSize()
This method should be defined by the subclass.
float MaximumHardwareLineWidth
virtual float * GetZbufferData(int, int, int, int)
Set/Get the zbuffer data from the frame buffer.
void SetFrameBlitModeToBlitToHardware()
SetGet how to handle blits at the end of a Frame() call.
virtual void PopContext()
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
virtual int SetPixelData(int, int, int, int, unsigned char *, int, int=0)
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
vtkTypeUInt32 vtkMTimeType
vtkTimeStamp ContextCreationTime
manage Shader Programs within a context
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
virtual int GetColorBufferSizes(int *)
Get the size of the color buffer.
record modification and/or execution time
void SetFrameBlitModeToBlitToCurrent()
SetGet how to handle blits at the end of a Frame() call.
FrameBlitModes FrameBlitMode
dynamic, self-adjusting array of float
vtkOpenGLQuadHelper * FlipQuad
std::string GetOpenGLSupportMessage()
Return a message profiding additional details about the results of calling SupportsOpenGL() This can ...
manage vertex buffer objects shared within a context
void Render() override
Ask each renderer owned by this RenderWindow to render its image and synchronize this process...
vtkOpenGLFramebufferObject * DepthFramebuffer
vtkOpenGLQuadHelper * DepthReadQuad
window superclass for vtkRenderWindow
virtual const char * ReportCapabilities()
Get report of capabilities for the render window.
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
virtual int SetZbufferData(int, int, int, int, float *)
Set/Get the zbuffer data from the frame buffer.
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
vtkTextureObject * DrawPixelsTextureObject
list of point or cell ids
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void WaitForCompletion()
Block the thread until the actual rendering is finished().
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
handles properties associated with a texture map
virtual void Initialize()
Initialize the rendering window.
virtual void ReleaseRGBAPixelData(float *)
Same as Get/SetPixelData except that the image also contains an alpha component.
virtual void MakeCurrent()
Make the window current.
virtual void PushContext()
Ability to push and pop this window's context as the current context.
boost::graph_traits< vtkGraph * >::vertex_descriptor source(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
Internal class which encapsulates OpenGL FramebufferObject.
vtkTextureObject * NoiseTextureObject
dynamic, self-adjusting array of unsigned char
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
allocate/free texture units.
abstracts an OpenGL texture object.
virtual int SetRGBAPixelData(int, int, int, int, float *, int, int=0, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.
create a window for renderers to draw into
virtual bool InitializeFromCurrentContext()
Initialize the render window from the information associated with the currently activated OpenGL cont...
virtual const char * GetRenderingBackend()
What rendering backend has the user requested.
void SetFrameBlitModeToNoBlit()
SetGet how to handle blits at the end of a Frame() call.
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
virtual unsigned char * GetRGBACharPixelData(int, int, int, int, int, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.
virtual void StereoMidpoint()
Intermediate method performs operations required between the rendering of the left and right eye...
vtkOpenGLQuadHelper * DepthBlitQuad
Class to make rendering a full screen quad easier.
FrameBlitModes
Define how the resulting image should be blitted when at the end of the Frame() call if SwapBuffers i...
vtkOpenGLFramebufferObject * RenderFramebuffer
virtual void End()
Update the system, if needed, at end of render process.
virtual float * GetRGBAPixelData(int, int, int, int, int, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.
vtkOpenGLBufferObject * TQuad2DVBO
virtual vtkOpenGLState * GetState()
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
std::map< std::string, int > GLStateIntegers
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
vtkOpenGLQuadHelper * ResolveQuad
virtual void Frame()
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkOpenGLFramebufferObject * DisplayFramebuffer
The ShaderProgram uses one or more Shader objects.
virtual int SetRGBACharPixelData(int, int, int, int, unsigned char *, int, int=0, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.