Go to the documentation of this file.
25 #ifndef vtkOpenGLRenderWindow_h
26 #define vtkOpenGLRenderWindow_h
28 #include "vtkRenderingOpenGL2Module.h"
61 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
62 static int GetGlobalMaximumNumberOfMultiSamples();
74 virtual unsigned char *
GetPixelData(
int x,
int y,
int x2,
int y2,
int front);
75 virtual int GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
91 int front,
int blend=0);
93 int front,
int blend=0);
100 unsigned char *
data,
int front,
112 virtual int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z );
115 virtual int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float *buffer );
151 virtual void SetSize(
int a[2]);
158 virtual void OpenGLInit();
161 virtual void OpenGLInitState();
164 virtual void OpenGLInitContext();
170 static bool GetContextSupportsOpenGL32();
171 void SetContextSupportsOpenGL32(
bool val);
179 void GetOpenGLVersion(
int &major,
int &minor);
188 unsigned int GetBackLeftBuffer();
197 unsigned int GetBackRightBuffer();
206 unsigned int GetFrontLeftBuffer();
215 unsigned int GetFrontRightBuffer();
224 unsigned int GetBackBuffer();
233 unsigned int GetFrontBuffer();
251 vtkGetMacro(FrameBufferObject,
unsigned int);
269 virtual void DrawPixels(
int x1,
int y1,
int x2,
int y2,
270 int numComponents,
int dataType,
void *
data);
276 virtual void DrawPixels(
277 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
278 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
279 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
285 virtual void DrawPixels(
286 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
292 return this->MaximumHardwareLineWidth; };
310 int GetDefaultTextureInternalFormat(
311 int vtktype,
int numComponents,
312 bool needInteger,
bool needFloat);
321 return this->OpenGLSupportMessage;
344 virtual void Initialize(
void) {};
346 std::set<vtkGenericOpenGLResourceFreeCallback *> Resources;
349 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
350 = this->Resources.find(cb);
351 if (it == this->Resources.end())
353 this->Resources.insert(cb);
358 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
359 = this->Resources.find(cb);
360 if (it != this->Resources.end())
362 this->Resources.erase(it);
391 void InitializeTextureInternalFormats();
395 virtual int GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
unsigned char*
data);
398 unsigned char*
data);
409 int CreateHardwareOffScreenWindow(
int width,
int height);
411 int CreateHardwareOffScreenBuffers(
int width,
int height,
bool bind =
false);
412 void BindHardwareOffScreenBuffers();
419 void DestroyHardwareOffScreenWindow();
421 void UnbindHardwareOffScreenBuffers();
422 void DestroyHardwareOffScreenBuffers();
427 int OffScreenUseFrameBuffer;
433 int NumberOfFrameBuffers;
434 unsigned int TextureObjects[4];
435 unsigned int FrameBufferObject;
436 unsigned int DepthRenderBufferObject;
437 int HardwareBufferSize[2];
438 bool HardwareOffScreenBuffersBind;
444 virtual void CreateAWindow() = 0;
449 virtual void DestroyWindow() = 0;
471 void RestoreGLState();
475 unsigned int BackLeftBuffer;
476 unsigned int BackRightBuffer;
477 unsigned int FrontLeftBuffer;
478 unsigned int FrontRightBuffer;
479 unsigned int FrontBuffer;
480 unsigned int BackBuffer;
482 #ifndef VTK_LEGACY_REMOVE
virtual void SetSize(int, int)
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
virtual int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0)=0
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 int SetRGBAPixelData(int x, int y, int x2, int y2, float *, int front, int blend=0)=0
std::map< const vtkTextureObject *, int > TextureResourceIds
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
std::string OpenGLSupportMessage
virtual void PopContext()
vtkTypeUInt64 vtkMTimeType
handles properties associated with a texture map
allocate/free texture units.
vtkOpenGLShaderCache * ShaderCache
The ShaderProgram uses one or more Shader objects.
virtual float * GetZbufferData(int x, int y, int x2, int y2)=0
Set/Get the zbuffer data from the frame buffer.
virtual unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front)=0
a simple class to control print indentation
abstracts an OpenGL texture object.
list of point or cell ids
virtual void WaitForCompletion()=0
Block the thread until the actual rendering is finished().
manage Shader Programs within a context
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
virtual int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front)=0
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
virtual unsigned char * GetPixelData(int x, int y, int x2, int y2, int front)=0
Get the pixel data of an image, transmitted as RGBRGBRGB.
virtual int SetZbufferData(int x, int y, int x2, int y2, float *z)=0
virtual void MakeCurrent()=0
Attempt to make this window the current graphics context for the calling thread.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void StereoUpdate()
Update the system, if needed, due to stereo rendering.
std::map< std::string, int > GLStateIntegers
virtual void ReleaseRGBAPixelData(float *data)=0
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
create a window for renderers to draw into
virtual const char * GetRenderingBackend()
What rendering backend has the user requested.
Wrapper around std::string to keep symbols short.
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.
unsigned int LastGraphicError
virtual float * GetRGBAPixelData(int x, int y, int x2, int y2, int front)=0
Same as Get/SetPixelData except that the image also contains an alpha component.