Go to the documentation of this file.
28 #ifndef vtkOpenGLRenderWindow_h
29 #define vtkOpenGLRenderWindow_h
33 #include "vtkRenderingOpenGL2Module.h"
41 class vtkOpenGLHardwareSupport;
68 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
69 static int GetGlobalMaximumNumberOfMultiSamples();
76 unsigned char *
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
81 int front,
int right)
override;
96 int front,
int blend=0,
int right=0)
override;
98 int front,
int blend=0,
int right=0)
override;
101 int front,
int right=0)
override;
106 unsigned char *
data,
int front,
107 int blend=0,
int right=0)
override;
110 int blend=0,
int right=0)
override;
118 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z )
override;
121 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float *buffer )
override;
150 bool GetUsingSRGBColorSpace();
163 int GetColorBufferInternalFormat(
int attachmentPoint);
169 void SetSize(
int a[2])
override;
170 void SetSize(
int,
int)
override;
176 virtual void OpenGLInit();
179 virtual void OpenGLInitState();
182 virtual void OpenGLInitContext();
189 void GetOpenGLVersion(
int &major,
int &minor);
198 unsigned int GetBackLeftBuffer();
207 unsigned int GetBackRightBuffer();
216 unsigned int GetFrontLeftBuffer();
225 unsigned int GetFrontRightBuffer();
234 unsigned int GetBackBuffer();
243 unsigned int GetFrontBuffer();
268 vtkGetMacro(FrameBufferObject,
unsigned int);
286 virtual void DrawPixels(
int x1,
int y1,
int x2,
int y2,
287 int numComponents,
int dataType,
void *
data);
293 virtual void DrawPixels(
294 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
295 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
296 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
302 virtual void DrawPixels(
303 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
309 return this->MaximumHardwareLineWidth; };
327 int GetDefaultTextureInternalFormat(
328 int vtktype,
int numComponents,
329 bool needInteger,
bool needFloat,
bool needSRGB);
338 return this->OpenGLSupportMessage;
366 virtual void Initialize(
void) {};
368 std::set<vtkGenericOpenGLResourceFreeCallback *> Resources;
371 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
372 = this->Resources.find(cb);
373 if (it == this->Resources.end())
375 this->Resources.insert(cb);
380 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
381 = this->Resources.find(cb);
382 if (it != this->Resources.end())
384 this->Resources.erase(it);
413 vtkGetMacro(DefaultFrameBufferId,
unsigned int);
429 return this->State; }
440 int GetNoiseTextureUnit();
475 void InitializeTextureInternalFormats();
479 virtual int ReadPixels(
const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right=0);
490 int CreateHardwareOffScreenWindow(
int width,
int height);
492 int CreateHardwareOffScreenBuffers(
int width,
int height,
bool bind =
false);
493 void BindHardwareOffScreenBuffers();
500 void DestroyHardwareOffScreenWindow();
502 void UnbindHardwareOffScreenBuffers();
503 void DestroyHardwareOffScreenBuffers();
515 unsigned int TextureObjects[4];
518 int HardwareBufferSize[2];
525 virtual void CreateAWindow() = 0;
530 virtual void DestroyWindow() = 0;
552 void RestoreGLState();
virtual void SetSize(int, int)
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
int NumberOfFrameBuffers
Variables used by the framebuffer-based offscreen method.
unsigned int DefaultFrameBufferId
virtual bool GetUseOffScreenBuffers()
float MaximumHardwareLineWidth
virtual int GetColorBufferSizes(int *rgba)=0
Get the size of the color buffer.
virtual int GetDepthBufferSize()=0
This method should be defined by the subclass.
dynamic, self-adjusting array of float
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
std::map< const vtkTextureObject *, int > TextureResourceIds
virtual float * GetRGBAPixelData(int x, int y, int x2, int y2, int front, int right=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
std::string GetOpenGLSupportMessage()
Return a message profiding additional details about the results of calling SupportsOpenGL() This can ...
#define VTK_UNICODE_STRING
record modification and/or execution time
virtual int SetUseOffScreenBuffers(bool)
Create and bind offscreen rendering buffers without destroying the current OpenGL context.
dynamic, self-adjusting array of unsigned char
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
vtkTextureObject * DrawPixelsTextureObject
unsigned int FrameBufferObject
vtkTextureUnitManager * TextureUnitManager
int OffScreenUseFrameBuffer
Flag telling if a framebuffer-based offscreen is currently in use.
unsigned int FrontRightBuffer
std::string OpenGLSupportMessage
virtual void PopContext()
vtkTimeStamp ContextCreationTime
handles properties associated with a texture map
allocate/free texture units.
vtkOpenGLShaderCache * ShaderCache
virtual void StereoMidpoint()
Intermediate method performs operations required between the rendering of the left and right eye.
bool HardwareOffScreenBuffersBind
vtkOpenGLVertexBufferObjectCache * VBOCache
The ShaderProgram uses one or more Shader objects.
int OwnContext
Flag telling if the context has been created here or was inherited.
virtual float * GetZbufferData(int x, int y, int x2, int y2)=0
Set/Get the zbuffer data from the frame buffer.
a simple class to control print indentation
abstracts an OpenGL texture object.
void Render() override
Ask each renderer owned by this RenderWindow to render its image and synchronize this process.
virtual int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int right=0)=0
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
unsigned int FrontLeftBuffer
vtkTextureObject * NoiseTextureObject
list of point or cell ids
virtual void WaitForCompletion()=0
Block the thread until the actual rendering is finished().
virtual vtkOpenGLState * GetState()
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.
manage Shader Programs within a context
virtual const char * ReportCapabilities()
Get report of capabilities for the render window.
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
virtual int SetZbufferData(int x, int y, int x2, int y2, float *z)=0
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, float *, int front, int blend=0, int right=0)=0
virtual unsigned char * GetPixelData(int x, int y, int x2, int y2, int front, int right=0)=0
Get the pixel data of an image, transmitted as RGBRGBRGB.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned int BackRightBuffer
virtual unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front, int right=0)=0
manage vertex buffer objects shared within a context
virtual void StereoUpdate()
Update the system, if needed, due to stereo rendering.
std::map< std::string, int > GLStateIntegers
virtual void ReleaseRGBAPixelData(float *data)=0
unsigned int BackLeftBuffer
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
virtual int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0, int right=0)=0
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.
Wrapper around std::string to keep symbols short.
vtkOpenGLBufferObject * TQuad2DVBO
unsigned int DepthRenderBufferObject
virtual void PushContext()
Ability to push and pop this window's context as the current context.
The VertexArrayObject class uses, or emulates, vertex array objects.
vtkTypeUInt32 vtkMTimeType