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
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.
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.