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
Wrapper around std::string to keep symbols short.
std::string OpenGLSupportMessage
virtual int SetUseOffScreenBuffers(bool)
Create and bind offscreen rendering buffers without destroying the current OpenGL context...
float MaximumHardwareLineWidth
virtual void PopContext()
manage Shader Programs within a context
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.
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 ...
virtual int GetColorBufferSizes(int *rgba)=0
Get the size of the color buffer.
#define VTK_UNICODE_STRING
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, float *, int front, int blend=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
vtkTypeUInt64 vtkMTimeType
virtual void SetSize(int, int)
Set/Get the size of the window in screen coordinates in pixels.
virtual unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
std::map< const vtkTextureObject *, int > TextureResourceIds
unsigned int LastGraphicError
a simple class to control print indentation
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
virtual void MakeCurrent()=0
Attempt to make this window the current graphics context for the calling thread.
virtual int GetDepthBufferSize()=0
This method should be defined by the subclass.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
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.
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.
handles properties associated with a texture map
virtual void StereoUpdate()
Update the system, if needed, due to stereo rendering.
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.
vtkOpenGLShaderCache * ShaderCache
abstracts an OpenGL texture object.
create a window for renderers to draw into
virtual const char * GetRenderingBackend()
What rendering backend has the user requested.
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
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 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 int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
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
The ShaderProgram uses one or more Shader objects.