25 #ifndef vtkOpenGLRenderWindow_h
26 #define vtkOpenGLRenderWindow_h
30 #include "vtkRenderingOpenGL2Module.h"
39 class vtkOpenGLHardwareSupport;
85 unsigned char*
GetPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right)
override;
89 int x,
int y,
int x2,
int y2,
unsigned char*
data,
int front,
int right)
override;
98 float*
GetRGBAPixelData(
int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
100 int x,
int y,
int x2,
int y2,
int front,
vtkFloatArray*
data,
int right = 0)
override;
102 int x,
int y,
int x2,
int y2,
float*
data,
int front,
int blend = 0,
int right = 0)
override;
104 int right = 0)
override;
107 int x,
int y,
int x2,
int y2,
int front,
int right = 0)
override;
111 int blend = 0,
int right = 0)
override;
113 int blend = 0,
int right = 0)
override;
282 int x1,
int y1,
int x2,
int y2,
int numComponents,
int dataType,
void*
data);
288 virtual void DrawPixels(
int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
int srcXmin,
289 int srcYmin,
int srcXmax,
int srcYmax,
int srcWidth,
int srcHeight,
int numComponents,
290 int dataType,
void*
data);
296 virtual void DrawPixels(
int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void*
data);
317 int vtktype,
int numComponents,
bool needInteger,
bool needFloat,
bool needSRGB);
344 std::set<vtkGenericOpenGLResourceFreeCallback*>
Resources;
348 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
349 if (it == this->Resources.end())
351 this->Resources.insert(cb);
357 std::set<vtkGenericOpenGLResourceFreeCallback*>::iterator it = this->Resources.find(cb);
358 if (it != this->Resources.end())
360 this->Resources.erase(it);
389 vtkGetMacro(DefaultFrameBufferId,
unsigned int);
453 const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right = 0);
dynamic, self-adjusting array of float
list of point or cell ids
a simple class to control print indentation
Internal class which encapsulates OpenGL FramebufferObject.
unsigned int FrontRightBuffer
void ReleaseGraphicsResources(vtkWindow *) override
Free up any graphics resources associated with this window a value of NULL means the context may alre...
void SetSize(int a[2]) override
int GetColorBufferInternalFormat(int attachmentPoint)
Get the internal format of current attached texture or render buffer.
int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int blend=0, int right=0) override
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...
std::map< std::string, int > GLStateIntegers
std::string GetOpenGLSupportMessage()
Return a message profiding additional details about the results of calling SupportsOpenGL() This can ...
int GetRGBAPixelData(int x, int y, int x2, int y2, int front, vtkFloatArray *data, int right=0) override
vtkOpenGLBufferObject * GetTQuad2DVBO()
virtual void DrawPixels(int x1, int y1, int x2, int y2, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function.
virtual void PopContext()
int SetRGBAPixelData(int x, int y, int x2, int y2, float *data, int front, int blend=0, int right=0) override
unsigned int FrontLeftBuffer
int GetTextureUnitForTexture(vtkTextureObject *)
Get the texture unit for a given texture object.
int OwnContext
Flag telling if the context has been created here or was inherited.
float MaximumHardwareLineWidth
int CreateOffScreenFramebuffer(int width, int height)
Create the offScreen framebuffer Return if the creation was successful or not.
unsigned int GetBackRightBuffer()
Return the OpenGL name of the back right buffer.
vtkOpenGLFramebufferObject * OffScreenFramebuffer
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
int GetZbufferData(int x1, int y1, int x2, int y2, float *z) override
void StereoMidpoint() override
Intermediate method performs operations required between the rendering of the left and right eye.
vtkTextureObject * NoiseTextureObject
unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front, int right=0) override
void End() override
Update the system, if needed, at end of render process.
unsigned int BackRightBuffer
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...
static void SetGlobalMaximumNumberOfMultiSamples(int val)
Set/Get the maximum number of multisamples.
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
vtkTextureUnitManager * GetTextureUnitManager()
Returns its texture unit manager object.
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...
void ActivateTexture(vtkTextureObject *)
Activate a texture unit for this texture.
unsigned int GetBackBuffer()
Return the OpenGL name of the back left buffer.
vtkTextureObject * DrawPixelsTextureObject
bool GetUsingSRGBColorSpace()
Is this window/fo in sRGB colorspace.
void Start(void) override
Begin the rendering process.
int GetColorBufferSizes(int *rgba) override
Get the size of the color buffer.
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 SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0, int right=0) override
void Render() override
Handle opengl specific code and calls superclass.
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
void SetSize(int width, int height) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
unsigned int GetFrontRightBuffer()
Return the OpenGL name of the front right buffer.
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
void ReleaseRGBAPixelData(float *data) override
unsigned int BackLeftBuffer
unsigned int GetFrontBuffer()
Return the OpenGL name of the front left buffer.
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
const char * GetRenderingBackend() override
What rendering backend has the user requested.
virtual void OpenGLInitContext()
unsigned int GetBackLeftBuffer()
Return the OpenGL name of the back left buffer.
void WaitForCompletion() override
Block the thread until the actual rendering is finished().
virtual void PushContext()
Ability to push and pop this window's context as the current context.
vtkOpenGLVertexBufferObjectCache * GetVBOCache()
Returns the VBO Cache.
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...
virtual void OpenGLInitState()
static int GetGlobalMaximumNumberOfMultiSamples()
virtual void CreateAWindow()=0
Create a not-off-screen window.
virtual int ReadPixels(const vtkRecti &rect, int front, int glFormat, int glType, void *data, int right=0)
unsigned int DefaultFrameBufferId
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
unsigned int GetFrontLeftBuffer()
Return the OpenGL name of the front left buffer.
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
int SetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer) override
virtual vtkMTimeType GetContextCreationTime()
Get the time when the OpenGL context was created.
const char * ReportCapabilities() override
Get report of capabilities for the render window.
int SetPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int right) override
int GetDepthBufferSize() override
Get the size of the depth buffer.
bool GetBufferNeedsResolving()
vtkTimeStamp ContextCreationTime
bool InitializeFromCurrentContext() override
Initialize the render window from the information associated with the currently activated OpenGL cont...
virtual vtkOpenGLState * GetState()
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
vtkOpenGLBufferObject * TQuad2DVBO
~vtkOpenGLRenderWindow() override
virtual void Initialize(void)
Initialize the rendering window.
vtkOpenGLShaderCache * GetShaderCache()
Returns an Shader Cache object.
virtual void OpenGLInit()
Initialize OpenGL for this window.
int SetZbufferData(int x1, int y1, int x2, int y2, float *buffer) override
void DeactivateTexture(vtkTextureObject *)
Deactivate a previously activated texture.
void RestoreGLState()
Restore OpenGL state at end of the rendering.
void GetOpenGLVersion(int &major, int &minor)
Get the major and minor version numbers of the OpenGL context we are using ala 3.2,...
void SaveGLState()
Query and save OpenGL state.
int GetNoiseTextureUnit()
int SetRGBAPixelData(int x, int y, int x2, int y2, vtkFloatArray *data, int front, int blend=0, int right=0) override
int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right=0) override
float * GetZbufferData(int x1, int y1, int x2, int y2) override
Set/Get the zbuffer data from an image.
int GetPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data, int right) override
virtual void DrawPixels(int srcWidth, int srcHeight, int numComponents, int dataType, void *data)
Replacement for the old glDrawPixels function.
int GetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *z) override
std::string OpenGLSupportMessage
manage Shader Programs within a context
The VertexArrayObject class uses, or emulates, vertex array objects.
manage vertex buffer objects shared within a context
create a window for renderers to draw into
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
The ShaderProgram uses one or more Shader objects.
Wrapper around std::string to keep symbols short.
abstracts an OpenGL texture object.
allocate/free texture units.
handles properties associated with a texture map
record modification and/or execution time
dynamic, self-adjusting array of unsigned char
window superclass for vtkRenderWindow
vtkTypeUInt32 vtkMTimeType