25 #ifndef vtkOpenGLRenderWindow_h 26 #define vtkOpenGLRenderWindow_h 30 #include "vtkRenderingOpenGL2Module.h" 37 class vtkOpenGLHardwareSupport;
63 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
64 static int GetGlobalMaximumNumberOfMultiSamples();
71 unsigned char *
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
76 int front,
int right)
override;
91 int front,
int blend=0,
int right=0)
override;
93 int front,
int blend=0,
int right=0)
override;
96 int front,
int right=0)
override;
101 unsigned char *
data,
int front,
102 int blend=0,
int right=0)
override;
105 int blend=0,
int right=0)
override;
113 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z )
override;
116 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float *buffer )
override;
145 bool GetUsingSRGBColorSpace();
157 void SetSize(
int a[2])
override;
158 void SetSize(
int,
int)
override;
164 virtual void OpenGLInit();
167 virtual void OpenGLInitState();
170 virtual void OpenGLInitContext();
176 static bool GetContextSupportsOpenGL32();
177 void SetContextSupportsOpenGL32(
bool val);
185 void GetOpenGLVersion(
int &major,
int &minor);
194 unsigned int GetBackLeftBuffer();
203 unsigned int GetBackRightBuffer();
212 unsigned int GetFrontLeftBuffer();
221 unsigned int GetFrontRightBuffer();
230 unsigned int GetBackBuffer();
239 unsigned int GetFrontBuffer();
264 vtkGetMacro(FrameBufferObject,
unsigned int);
282 virtual void DrawPixels(
int x1,
int y1,
int x2,
int y2,
283 int numComponents,
int dataType,
void *
data);
289 virtual void DrawPixels(
290 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
291 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
292 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
298 virtual void DrawPixels(
299 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
305 return this->MaximumHardwareLineWidth; };
323 int GetDefaultTextureInternalFormat(
324 int vtktype,
int numComponents,
325 bool needInteger,
bool needFloat,
bool needSRGB);
334 return this->OpenGLSupportMessage;
362 virtual void Initialize(
void) {};
364 std::set<vtkGenericOpenGLResourceFreeCallback *> Resources;
367 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
368 = this->Resources.find(cb);
369 if (it == this->Resources.end())
371 this->Resources.insert(cb);
376 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
377 = this->Resources.find(cb);
378 if (it != this->Resources.end())
380 this->Resources.erase(it);
409 vtkGetMacro(DefaultFrameBufferId,
unsigned int);
436 void InitializeTextureInternalFormats();
440 virtual int ReadPixels(
const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right=0);
451 int CreateHardwareOffScreenWindow(
int width,
int height);
453 int CreateHardwareOffScreenBuffers(
int width,
int height,
bool bind =
false);
454 void BindHardwareOffScreenBuffers();
461 void DestroyHardwareOffScreenWindow();
463 void UnbindHardwareOffScreenBuffers();
464 void DestroyHardwareOffScreenBuffers();
476 unsigned int TextureObjects[4];
479 int HardwareBufferSize[2];
486 virtual void CreateAWindow() = 0;
491 virtual void DestroyWindow() = 0;
513 void RestoreGLState();
int OwnContext
Flag telling if the context has been created here or was inherited.
Wrapper around std::string to keep symbols short.
virtual unsigned char * GetPixelData(int x, int y, int x2, int y2, int front, int right=0)=0
Get the pixel data of an image, transmitted as RGBRGBRGB.
int OffScreenUseFrameBuffer
Flag telling if a framebuffer-based offscreen is currently in use.
std::string OpenGLSupportMessage
virtual int SetUseOffScreenBuffers(bool)
Create and bind offscreen rendering buffers without destroying the current OpenGL context...
float MaximumHardwareLineWidth
virtual void PopContext()
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, float *, int front, int blend=0, int right=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
vtkTypeUInt32 vtkMTimeType
vtkTimeStamp ContextCreationTime
manage Shader Programs within a context
int NumberOfFrameBuffers
Variables used by the framebuffer-based offscreen method.
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
bool HardwareOffScreenBuffersBind
Variables used by the framebuffer-based offscreen method.
record modification and/or execution time
dynamic, self-adjusting array of float
vtkTextureUnitManager * TextureUnitManager
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
virtual int GetColorBufferSizes(int *rgba)=0
Get the size of the color buffer.
#define VTK_UNICODE_STRING
unsigned int FrontLeftBuffer
virtual int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int right=0)=0
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
virtual void SetSize(int, int)
Set/Get the size of the window in screen coordinates in pixels.
virtual const char * ReportCapabilities()
Get report of capabilities for the render window.
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
virtual int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0, int right=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
std::map< const vtkTextureObject *, int > TextureResourceIds
a simple class to control print indentation
virtual float * GetRGBAPixelData(int x, int y, int x2, int y2, int front, int right=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
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
unsigned int FrameBufferObject
Variables used by the framebuffer-based offscreen method.
list of point or cell ids
unsigned int BackLeftBuffer
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual int GetDepthBufferSize()=0
This method should be defined by the subclass.
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.
handles properties associated with a texture map
virtual void PushContext()
Ability to push and pop this window's context as the current context.
unsigned int DefaultFrameBufferId
virtual unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front, int right=0)=0
Same as Get/SetPixelData except that the image also contains an alpha component.
dynamic, self-adjusting array of unsigned char
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
allocate/free texture units.
vtkOpenGLShaderCache * ShaderCache
abstracts an OpenGL texture object.
unsigned int BackRightBuffer
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 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.
unsigned int FrontRightBuffer
unsigned int DepthRenderBufferObject
Variables used by the framebuffer-based offscreen method.
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
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.
vtkOpenGLVertexBufferObjectCache * VBOCache
The ShaderProgram uses one or more Shader objects.