28 #ifndef vtkOpenGLRenderWindow_h 29 #define vtkOpenGLRenderWindow_h 33 #include "vtkRenderingOpenGL2Module.h" 66 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
67 static int GetGlobalMaximumNumberOfMultiSamples();
74 unsigned char *
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
79 int front,
int right)
override;
94 int front,
int blend=0,
int right=0)
override;
96 int front,
int blend=0,
int right=0)
override;
99 int front,
int right=0)
override;
104 unsigned char *
data,
int front,
105 int blend=0,
int right=0)
override;
108 int blend=0,
int right=0)
override;
116 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z )
override;
119 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float *buffer )
override;
148 bool GetUsingSRGBColorSpace();
160 void SetSize(
int a[2])
override;
161 void SetSize(
int,
int)
override;
167 virtual void OpenGLInit();
170 virtual void OpenGLInitState();
173 virtual void OpenGLInitContext();
179 static bool GetContextSupportsOpenGL32();
180 void SetContextSupportsOpenGL32(
bool val);
188 void GetOpenGLVersion(
int &major,
int &minor);
197 unsigned int GetBackLeftBuffer();
206 unsigned int GetBackRightBuffer();
215 unsigned int GetFrontLeftBuffer();
224 unsigned int GetFrontRightBuffer();
233 unsigned int GetBackBuffer();
242 unsigned int GetFrontBuffer();
267 vtkGetMacro(FrameBufferObject,
unsigned int);
285 virtual void DrawPixels(
int x1,
int y1,
int x2,
int y2,
286 int numComponents,
int dataType,
void *
data);
292 virtual void DrawPixels(
293 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
294 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
295 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
301 virtual void DrawPixels(
302 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
308 return this->MaximumHardwareLineWidth; };
326 int GetDefaultTextureInternalFormat(
327 int vtktype,
int numComponents,
328 bool needInteger,
bool needFloat,
bool needSRGB);
337 return this->OpenGLSupportMessage;
365 virtual void Initialize(
void) {};
367 std::set<vtkGenericOpenGLResourceFreeCallback *> Resources;
370 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
371 = this->Resources.find(cb);
372 if (it == this->Resources.end())
374 this->Resources.insert(cb);
379 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
380 = this->Resources.find(cb);
381 if (it != this->Resources.end())
383 this->Resources.erase(it);
412 vtkGetMacro(DefaultFrameBufferId,
unsigned int);
439 void InitializeTextureInternalFormats();
443 virtual int ReadPixels(
const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right=0);
454 int CreateHardwareOffScreenWindow(
int width,
int height);
456 int CreateHardwareOffScreenBuffers(
int width,
int height,
bool bind =
false);
457 void BindHardwareOffScreenBuffers();
464 void DestroyHardwareOffScreenWindow();
466 void UnbindHardwareOffScreenBuffers();
467 void DestroyHardwareOffScreenBuffers();
472 int OffScreenUseFrameBuffer;
478 int NumberOfFrameBuffers;
479 unsigned int TextureObjects[4];
480 unsigned int FrameBufferObject;
481 unsigned int DepthRenderBufferObject;
482 int HardwareBufferSize[2];
483 bool HardwareOffScreenBuffersBind;
489 virtual void CreateAWindow() = 0;
494 virtual void DestroyWindow() = 0;
516 void RestoreGLState();
520 unsigned int BackLeftBuffer;
521 unsigned int BackRightBuffer;
522 unsigned int FrontLeftBuffer;
523 unsigned int FrontRightBuffer;
524 unsigned int FrontBuffer;
525 unsigned int BackBuffer;
528 #ifndef VTK_LEGACY_REMOVE
Wrapper around std::string to keep symbols short.
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.
std::string OpenGLSupportMessage
virtual int SetUseOffScreenBuffers(bool)
Create and bind offscreen rendering buffers without destroying the current OpenGL context...
float MaximumHardwareLineWidth
virtual void PopContext()
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, float *, int front, int blend=0, int right=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
vtkTypeUInt32 vtkMTimeType
manage Shader Programs within a context
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
record modification and/or execution time
dynamic, self-adjusting array of float
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
virtual int GetColorBufferSizes(int *rgba)=0
Get the size of the color buffer.
#define VTK_UNICODE_STRING
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.
virtual void SetSize(int, int)
Set/Get the size of the window in screen coordinates in pixels.
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 SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0, int right=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
std::map< const vtkTextureObject *, int > TextureResourceIds
unsigned int LastGraphicError
a simple class to control print indentation
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.
The VertexArrayObject class uses, or emulates, vertex array objects.
virtual void ReleaseRGBAPixelData(float *data)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
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 int GetDepthBufferSize()=0
This method should be defined by the subclass.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
virtual int SetZbufferData(int x, int y, int x2, int y2, float *z)=0
Set/Get the zbuffer data from the frame buffer.
handles properties associated with a texture map
virtual void PushContext()
Ability to push and pop this window's context as the current context.
unsigned int DefaultFrameBufferId
virtual unsigned char * GetRGBACharPixelData(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.
dynamic, self-adjusting array of unsigned char
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
allocate/free texture units.
vtkOpenGLShaderCache * ShaderCache
abstracts an OpenGL texture object.
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.
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
virtual float * GetZbufferData(int x, int y, int x2, int y2)=0
Set/Get the zbuffer data from the frame buffer.
virtual bool GetUseOffScreenBuffers()
virtual void WaitForCompletion()=0
Block the thread until the actual rendering is finished().
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
std::map< std::string, int > GLStateIntegers
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.
vtkOpenGLVertexBufferObjectCache * VBOCache
The ShaderProgram uses one or more Shader objects.