28 #ifndef vtkOpenGLRenderWindow_h
29 #define vtkOpenGLRenderWindow_h
34 #include "vtkRenderingOpenGL2Module.h"
43 class vtkOpenGLHardwareSupport;
65 void Start(
void)
override;
71 void Frame()
override;
82 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
83 static int GetGlobalMaximumNumberOfMultiSamples();
92 unsigned char*
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
override;
96 int x,
int y,
int x2,
int y2,
unsigned char*
data,
int front,
int right)
override;
105 float*
GetRGBAPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
107 int x,
int y,
int x2,
int y2,
int front,
vtkFloatArray*
data,
int right = 0)
override;
109 int x,
int y,
int x2,
int y2,
float*
data,
int front,
int blend = 0,
int right = 0)
override;
111 int right = 0)
override;
114 int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
118 int blend = 0,
int right = 0)
override;
120 int blend = 0,
int right = 0)
override;
128 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z)
override;
130 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* buffer)
override;
157 bool GetUsingSRGBColorSpace();
170 int GetColorBufferInternalFormat(
int attachmentPoint);
175 virtual void OpenGLInit();
178 virtual void OpenGLInitState();
181 virtual void OpenGLInitContext();
188 void GetOpenGLVersion(
int& major,
int& minor);
192 unsigned
int GetBackLeftBuffer();
194 unsigned int GetBackRightBuffer();
196 unsigned int GetFrontLeftBuffer();
198 unsigned int GetFrontRightBuffer();
200 unsigned int GetBackBuffer();
202 unsigned int GetFrontBuffer();
226 vtkOpenGLFramebufferObject* GetOffScreenFramebuffer() {
return this->RenderFramebuffer; }
249 virtual void DrawPixels(
250 int x1,
int y1,
int x2,
int y2,
int numComponents,
int dataType,
void*
data);
256 virtual void DrawPixels(
int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
int srcXmin,
257 int srcYmin,
int srcXmax,
int srcYmax,
int srcWidth,
int srcHeight,
int numComponents,
258 int dataType,
void*
data);
264 virtual void DrawPixels(
int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void*
data);
284 int GetDefaultTextureInternalFormat(
285 int vtktype,
int numComponents,
bool needInteger,
bool needFloat,
bool needSRGB);
312 std::set<vtkGenericOpenGLResourceFreeCallback*>
Resources;
316 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
317 if (it == this->Resources.end())
319 this->Resources.insert(cb);
325 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
326 if (it != this->Resources.end())
328 this->Resources.erase(it);
374 int GetNoiseTextureUnit();
393 bool GetBufferNeedsResolving();
404 void BlitDisplayFramebuffer();
409 void BlitDisplayFramebuffer(
int right,
int srcX,
int srcY,
int srcWidth,
int srcHeight,
int destX,
410 int destY,
int destWidth,
int destHeight,
int bufferMode,
int interpolation);
417 void BlitToRenderFramebuffer(
bool includeDepth);
418 void BlitToRenderFramebuffer(
int srcX,
int srcY,
int srcWidth,
int srcHeight,
int destX,
419 int destY,
int destWidth,
int destHeight,
int bufferMode,
int interpolation);
438 vtkSetClampMacro(FrameBlitMode, FrameBlitModes, BlitToHardware, NoBlit);
439 vtkGetMacro(FrameBlitMode, FrameBlitModes);
449 vtkSetMacro(FramebufferFlipY,
bool);
450 vtkGetMacro(FramebufferFlipY,
bool);
451 vtkBooleanMacro(FramebufferFlipY,
bool);
468 int destX,
int destY,
int destX2,
int destY2);
476 virtual void BlitDisplayFramebuffersToHardware();
496 virtual bool ResolveFlipRenderFramebuffer();
504 virtual int ReadPixels(
505 const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right = 0);
515 int CreateFramebuffers(
int width,
int height);
526 virtual void CreateAWindow() = 0;
531 virtual void DestroyWindow() = 0;
541 void RestoreGLState();
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
vtkOpenGLFramebufferObject * ResolveFramebuffer
virtual void Start()
Start the rendering process for a frame.
Wrapper around std::string to keep symbols short.
#define VTK_DEPRECATED_IN_9_1_0(reason)
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...
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 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 void Initialize(void)
Initialize the rendering window.
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.