25 #ifndef vtkOpenGLRenderWindow_h
26 #define vtkOpenGLRenderWindow_h
30 #include "vtkRenderingOpenGL2Module.h"
63 static
void SetGlobalMaximumNumberOfMultiSamples(
int val);
64 static
int GetGlobalMaximumNumberOfMultiSamples();
70 void StereoUpdate() VTK_OVERRIDE;
76 unsigned char *GetPixelData(
int x,
int y,
int x2,
int y2,
int front) VTK_OVERRIDE;
77 int GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
79 int SetPixelData(
int x,
int y,
int x2,
int y2,
unsigned char *
data,
80 int front) VTK_OVERRIDE;
81 int SetPixelData(
int x,
int y,
int x2,
int y2,
89 float *GetRGBAPixelData(
int x,
int y,
int x2,
int y2,
int front) VTK_OVERRIDE;
90 int GetRGBAPixelData(
int x,
int y,
int x2,
int y2,
int front,
92 int SetRGBAPixelData(
int x,
int y,
int x2,
int y2,
float *data,
93 int front,
int blend=0) VTK_OVERRIDE;
94 int SetRGBAPixelData(
int x,
int y,
int x2,
int y2,
vtkFloatArray *data,
95 int front,
int blend=0) VTK_OVERRIDE;
96 void ReleaseRGBAPixelData(
float *data) VTK_OVERRIDE;
97 unsigned char *GetRGBACharPixelData(
int x,
int y,
int x2,
int y2,
98 int front) VTK_OVERRIDE;
99 int GetRGBACharPixelData(
int x,
int y,
int x2,
int y2,
int front,
101 int SetRGBACharPixelData(
int x,
int y,
int x2,
int y2,
102 unsigned char *data,
int front,
103 int blend=0) VTK_OVERRIDE;
104 int SetRGBACharPixelData(
int x,
int y,
int x2,
int y2,
106 int blend=0) VTK_OVERRIDE;
113 float *GetZbufferData(
int x1,
int y1,
int x2,
int y2 ) VTK_OVERRIDE;
114 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z ) VTK_OVERRIDE;
115 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
117 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float *buffer ) VTK_OVERRIDE;
118 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
131 void DeactivateTexture(vtkTextureObject *);
136 int GetTextureUnitForTexture(vtkTextureObject *);
141 int GetDepthBufferSize() VTK_OVERRIDE;
147 int GetColorBufferSizes(
int *rgba) VTK_OVERRIDE;
153 void SetSize(
int a[2]) VTK_OVERRIDE;
154 void SetSize(
int,
int) VTK_OVERRIDE;
160 virtual
void OpenGLInit();
163 virtual
void OpenGLInitState();
166 virtual
void OpenGLInitContext();
172 static
bool GetContextSupportsOpenGL32();
173 void SetContextSupportsOpenGL32(
bool val);
181 void GetOpenGLVersion(
int &major,
int &minor);
190 unsigned int GetBackLeftBuffer();
199 unsigned int GetBackRightBuffer();
208 unsigned int GetFrontLeftBuffer();
217 unsigned int GetFrontRightBuffer();
226 unsigned int GetBackBuffer();
235 unsigned int GetFrontBuffer();
260 vtkGetMacro(FrameBufferObject,
unsigned int);
273 void WaitForCompletion() VTK_OVERRIDE;
278 virtual
void DrawPixels(
int x1,
int y1,
int x2,
int y2,
279 int numComponents,
int dataType,
void *data);
285 virtual
void DrawPixels(
286 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
287 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
288 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *data);
294 virtual
void DrawPixels(
295 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *data);
300 virtual
float GetMaximumHardwareLineWidth() {
301 return this->MaximumHardwareLineWidth; };
319 int GetDefaultTextureInternalFormat(
320 int vtktype,
int numComponents,
321 bool needInteger,
bool needFloat);
330 return this->OpenGLSupportMessage;
345 int SupportsOpenGL() VTK_OVERRIDE;
350 const
char *ReportCapabilities() VTK_OVERRIDE;
358 virtual
void Initialize(
void) {};
360 std::set<vtkGenericOpenGLResourceFreeCallback *> Resources;
363 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
364 = this->Resources.find(cb);
365 if (it == this->Resources.end())
367 this->Resources.insert(cb);
372 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
373 = this->Resources.find(cb);
374 if (it != this->Resources.end())
376 this->Resources.erase(it);
405 vtkGetMacro(DefaultFrameBufferId,
unsigned int);
409 ~vtkOpenGLRenderWindow() VTK_OVERRIDE;
416 bool OpenGLSupportTested;
417 int OpenGLSupportResult;
418 std::
string OpenGLSupportMessage;
421 void InitializeTextureInternalFormats();
425 virtual
int ReadPixels(const
vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data);
436 int CreateHardwareOffScreenWindow(
int width,
int height);
438 int CreateHardwareOffScreenBuffers(
int width,
int height,
bool bind = false);
439 void BindHardwareOffScreenBuffers();
446 void DestroyHardwareOffScreenWindow();
448 void UnbindHardwareOffScreenBuffers();
449 void DestroyHardwareOffScreenBuffers();
454 int OffScreenUseFrameBuffer;
460 int NumberOfFrameBuffers;
461 unsigned int TextureObjects[4];
462 unsigned int FrameBufferObject;
463 unsigned int DepthRenderBufferObject;
464 int HardwareBufferSize[2];
465 bool HardwareOffScreenBuffersBind;
471 virtual
void CreateAWindow() = 0;
476 virtual
void DestroyWindow() = 0;
498 void RestoreGLState();
500 std::map<std::
string,
int> GLStateIntegers;
502 unsigned int BackLeftBuffer;
503 unsigned int BackRightBuffer;
504 unsigned int FrontLeftBuffer;
505 unsigned int FrontRightBuffer;
506 unsigned int FrontBuffer;
507 unsigned int BackBuffer;
508 unsigned int DefaultFrameBufferId;
510 #ifndef VTK_LEGACY_REMOVE
537 vtkOpenGLRenderWindow(
const vtkOpenGLRenderWindow&) VTK_DELETE_FUNCTION;
538 void operator=(const vtkOpenGLRenderWindow&) VTK_DELETE_FUNCTION;
Wrapper around std::string to keep symbols short.
virtual int SetUseOffScreenBuffers(bool)
Create and bind offscreen rendering buffers without destroying the current OpenGL context...
float MaximumHardwareLineWidth
virtual void PopContext()
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
#define VTK_UNICODE_STRING
unsigned int LastGraphicError
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.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
handles properties associated with a texture map
virtual void PushContext()
Ability to push and pop this window's context as the current context.
dynamic, self-adjusting array of unsigned char
allocate/free texture units.
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 bool GetUseOffScreenBuffers()
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.
The ShaderProgram uses one or more Shader objects.