Go to the documentation of this file.
28 #ifndef vtkOpenGLRenderWindow_h
29 #define vtkOpenGLRenderWindow_h
33 #include "vtkRenderingOpenGL2Module.h"
41 class vtkOpenGLHardwareSupport;
76 unsigned char *
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
81 int front,
int right)
override;
96 int front,
int blend=0,
int right=0)
override;
98 int front,
int blend=0,
int right=0)
override;
101 int front,
int right=0)
override;
106 unsigned char *
data,
int front,
107 int blend=0,
int right=0)
override;
110 int blend=0,
int right=0)
override;
268 vtkGetMacro(FrameBufferObject,
unsigned int);
287 int numComponents,
int dataType,
void *
data);
294 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
295 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
296 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
303 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
309 return this->MaximumHardwareLineWidth; };
328 int vtktype,
int numComponents,
329 bool needInteger,
bool needFloat,
bool needSRGB);
338 return this->OpenGLSupportMessage;
368 std::set<vtkGenericOpenGLResourceFreeCallback *>
Resources;
371 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
372 = this->Resources.find(cb);
373 if (it == this->Resources.end())
375 this->Resources.insert(cb);
380 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
381 = this->Resources.find(cb);
382 if (it != this->Resources.end())
384 this->Resources.erase(it);
413 vtkGetMacro(DefaultFrameBufferId,
unsigned int);
429 return this->State; }
515 unsigned int TextureObjects[4];
518 int HardwareBufferSize[2];
void StereoMidpoint() override
Intermediate method performs operations required between the rendering of the left and right eye.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkMTimeType GetContextCreationTime()
Get the time when the OpenGL context was created.
virtual void OpenGLInit()
Initialize OpenGL for this window.
void DestroyHardwareOffScreenBuffers()
void GetOpenGLVersion(int &major, int &minor)
Get the major and minor version numbers of the OpenGL context we are using ala 3.2,...
void SetSize(int a[2]) override
Set the size of the window in screen coordinates in pixels.
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
void ActivateTexture(vtkTextureObject *)
Activate a texture unit for this texture.
virtual void DrawPixels(int x1, int y1, int x2, int y2, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function.
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
int SetRGBAPixelData(int x, int y, int x2, int y2, vtkFloatArray *data, int front, int blend=0, int right=0) override
vtkOpenGLBufferObject * GetTQuad2DVBO()
int NumberOfFrameBuffers
Variables used by the framebuffer-based offscreen method.
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
unsigned int DefaultFrameBufferId
void DestroyHardwareOffScreenWindow()
Destroy an offscreen window based on OpenGL framebuffer extension.
float MaximumHardwareLineWidth
virtual void DrawPixels(int srcWidth, int srcHeight, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function.
dynamic, self-adjusting array of float
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
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
void SetSize(int, int) override
void SetTextureUnitManager(vtkTextureUnitManager *textureUnitManager)
Set the texture unit manager.
dynamic, self-adjusting array of unsigned char
void BindHardwareOffScreenBuffers()
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)
int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
int GetPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right) override
int CreateHardwareOffScreenWindow(int width, int height)
Create an offScreen window based on OpenGL framebuffer extension.
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
vtkTextureObject * DrawPixelsTextureObject
unsigned int FrameBufferObject
int SetUseOffScreenBuffers(bool offScreen) override
Create and bind offscreen rendering buffers without destroying the current OpenGL context.
unsigned int GetBackLeftBuffer()
Return the OpenGL name of the back left buffer.
vtkTextureUnitManager * TextureUnitManager
int GetDepthBufferSize() override
Get the size of the depth buffer.
int OffScreenUseFrameBuffer
Flag telling if a framebuffer-based offscreen is currently in use.
unsigned int FrontRightBuffer
std::string OpenGLSupportMessage
unsigned int GetBackRightBuffer()
Return the OpenGL name of the back right buffer.
virtual void DrawPixels(int dstXmin, int dstYmin, int dstXmax, int dstYmax, int srcXmin, int srcYmin, int srcXmax, int srcYmax, int srcWidth, int srcHeight, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function, but it allows for scaling the data and using only part...
const char * GetRenderingBackend() override
What rendering backend has the user requested.
virtual void PopContext()
float * GetRGBAPixelData(int x, int y, int x2, int y2, int front, int right=0) override
Set/Get the pixel data of an image, transmitted as RGBARGBA...
void SaveGLState()
Query and save OpenGL state.
vtkTimeStamp ContextCreationTime
handles properties associated with a texture map
allocate/free texture units.
vtkOpenGLShaderCache * ShaderCache
void DeactivateTexture(vtkTextureObject *)
Deactivate a previously activated texture.
bool HardwareOffScreenBuffersBind
void Render() override
Handle opengl specific code and calls superclass.
vtkOpenGLVertexBufferObjectCache * VBOCache
int GetTextureUnitForTexture(vtkTextureObject *)
Get the texture unit for a given texture object.
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
virtual void OpenGLInitState()
The ShaderProgram uses one or more Shader objects.
int OwnContext
Flag telling if the context has been created here or was inherited.
int GetZbufferData(int x1, int y1, int x2, int y2, float *z) override
virtual void OpenGLInitContext()
a simple class to control print indentation
abstracts an OpenGL texture object.
float * GetZbufferData(int x1, int y1, int x2, int y2) override
Set/Get the zbuffer data from an image.
unsigned int GetFrontBuffer()
Return the OpenGL name of the front left buffer.
int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0, int right=0) override
bool GetUseOffScreenBuffers() override
unsigned int FrontLeftBuffer
vtkTextureObject * NoiseTextureObject
list of point or cell ids
virtual vtkOpenGLState * GetState()
void ReleaseRGBAPixelData(float *data) override
bool GetUsingSRGBColorSpace()
Is this window/fo in sRGB colorspace.
void MakeCurrent() override=0
Attempt to make this window the current graphics context for the calling thread.
manage Shader Programs within a context
unsigned int GetBackBuffer()
Return the OpenGL name of the back left buffer.
vtkTextureUnitManager * GetTextureUnitManager()
Returns its texture unit manager object.
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
unsigned char * GetPixelData(int x, int y, int x2, int y2, int front, int right) override
Set/Get the pixel data of an image, transmitted as RGBRGB...
void RestoreGLState()
Restore OpenGL state at end of the rendering.
unsigned int GetFrontLeftBuffer()
Return the OpenGL name of the front left buffer.
const char * ReportCapabilities() override
Get report of capabilities for the render window.
int CreateHardwareOffScreenBuffers(int width, int height, bool bind=false)
int GetRGBAPixelData(int x, int y, int x2, int y2, int front, vtkFloatArray *data, int right=0) override
unsigned int GetFrontRightBuffer()
Return the OpenGL name of the front right buffer.
int SetPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int right) override
int GetColorBufferInternalFormat(int attachmentPoint)
Get the internal format of current attached texture or render buffer.
unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front, int right=0) override
int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int blend=0, int right=0) override
unsigned int BackRightBuffer
int GetNoiseTextureUnit()
virtual void ReleaseGraphicsResources(vtkRenderWindow *)
Free up any graphics resources associated with this window a value of NULL means the context may alre...
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
manage vertex buffer objects shared within a context
void InitializeTextureInternalFormats()
int GetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *z) override
static int GetGlobalMaximumNumberOfMultiSamples()
int SetZbufferData(int x1, int y1, int x2, int y2, float *buffer) override
std::map< std::string, int > GLStateIntegers
int SetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer) override
unsigned int BackLeftBuffer
int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right=0) override
create a window for renderers to draw into
Wrapper around std::string to keep symbols short.
void StereoUpdate() override
Update the system, if needed, due to stereo rendering.
vtkOpenGLBufferObject * TQuad2DVBO
unsigned int DepthRenderBufferObject
void UnbindHardwareOffScreenBuffers()
static void SetGlobalMaximumNumberOfMultiSamples(int val)
Set/Get the maximum number of multisamples.
virtual void PushContext()
Ability to push and pop this window's context as the current context.
~vtkOpenGLRenderWindow() override
void WaitForCompletion() override
Block the thread until the actual rendering is finished().
The VertexArrayObject class uses, or emulates, vertex array objects.
virtual void Initialize(void)
Initialize the rendering window.
virtual void CreateAWindow()=0
Create a not-off-screen window.
vtkTypeUInt32 vtkMTimeType
int SetRGBAPixelData(int x, int y, int x2, int y2, float *data, int front, int blend=0, int right=0) override
int GetDefaultTextureInternalFormat(int vtktype, int numComponents, bool needInteger, bool needFloat, bool needSRGB)
Get a mapping of vtk data types to native texture formats for this window we put this on the RenderWi...