Go to the documentation of this file.
28 #ifndef vtkOpenGLRenderWindow_h
29 #define vtkOpenGLRenderWindow_h
31 #include "vtkRenderingOpenGL2Module.h"
64 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
65 static int GetGlobalMaximumNumberOfMultiSamples();
77 virtual unsigned char *
GetPixelData(
int x,
int y,
int x2,
int y2,
int front);
78 virtual int GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
94 int front,
int blend=0);
96 int front,
int blend=0);
103 unsigned char *
data,
int front,
115 virtual int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z );
118 virtual int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float *buffer );
154 virtual void SetSize(
int a[2]);
161 virtual void OpenGLInit();
164 virtual void OpenGLInitState();
167 virtual void OpenGLInitContext();
173 static bool GetContextSupportsOpenGL32();
174 void SetContextSupportsOpenGL32(
bool val);
182 void GetOpenGLVersion(
int &major,
int &minor);
191 unsigned int GetBackLeftBuffer();
200 unsigned int GetBackRightBuffer();
209 unsigned int GetFrontLeftBuffer();
218 unsigned int GetFrontRightBuffer();
227 unsigned int GetBackBuffer();
236 unsigned int GetFrontBuffer();
254 vtkGetMacro(FrameBufferObject,
unsigned int);
272 virtual void DrawPixels(
int x1,
int y1,
int x2,
int y2,
273 int numComponents,
int dataType,
void *
data);
279 virtual void DrawPixels(
280 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
281 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
282 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
288 virtual void DrawPixels(
289 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
295 return this->MaximumHardwareLineWidth; };
313 int GetDefaultTextureInternalFormat(
314 int vtktype,
int numComponents,
315 bool needInteger,
bool needFloat);
324 return this->OpenGLSupportMessage;
347 virtual void Initialize(
void) {};
349 std::set<vtkGenericOpenGLResourceFreeCallback *> Resources;
352 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
353 = this->Resources.find(cb);
354 if (it == this->Resources.end())
356 this->Resources.insert(cb);
361 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
362 = this->Resources.find(cb);
363 if (it != this->Resources.end())
365 this->Resources.erase(it);
394 void InitializeTextureInternalFormats();
398 virtual int GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
unsigned char*
data);
401 unsigned char*
data);
412 int CreateHardwareOffScreenWindow(
int width,
int height);
414 int CreateHardwareOffScreenBuffers(
int width,
int height,
bool bind =
false);
415 void BindHardwareOffScreenBuffers();
422 void DestroyHardwareOffScreenWindow();
424 void UnbindHardwareOffScreenBuffers();
425 void DestroyHardwareOffScreenBuffers();
430 int OffScreenUseFrameBuffer;
436 int NumberOfFrameBuffers;
437 unsigned int TextureObjects[4];
438 unsigned int FrameBufferObject;
439 unsigned int DepthRenderBufferObject;
440 int HardwareBufferSize[2];
441 bool HardwareOffScreenBuffersBind;
447 virtual void CreateAWindow() = 0;
452 virtual void DestroyWindow() = 0;
474 void RestoreGLState();
478 unsigned int BackLeftBuffer;
479 unsigned int BackRightBuffer;
480 unsigned int FrontLeftBuffer;
481 unsigned int FrontRightBuffer;
482 unsigned int FrontBuffer;
483 unsigned int BackBuffer;
485 #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.