25 #ifndef vtkOpenGLRenderWindow_h 26 #define vtkOpenGLRenderWindow_h 30 #include "vtkRenderingOpenGL2Module.h" 39 class vtkOpenGLHardwareSupport;
60 void Start(
void)
override;
66 void Frame()
override;
77 static void SetGlobalMaximumNumberOfMultiSamples(
int val);
78 static int GetGlobalMaximumNumberOfMultiSamples();
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;
121 int GetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* z)
override;
123 int SetZbufferData(
int x1,
int y1,
int x2,
int y2,
float* buffer)
override;
150 bool GetUsingSRGBColorSpace();
163 int GetColorBufferInternalFormat(
int attachmentPoint);
181 virtual void OpenGLInit();
184 virtual void OpenGLInitState();
187 virtual void OpenGLInitContext();
194 void GetOpenGLVersion(
int& major,
int& minor);
203 unsigned int GetBackLeftBuffer();
212 unsigned int GetBackRightBuffer();
221 unsigned int GetFrontLeftBuffer();
230 unsigned int GetFrontRightBuffer();
236 unsigned int GetBackBuffer();
242 unsigned int GetFrontBuffer();
281 virtual void DrawPixels(
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);
316 int GetDefaultTextureInternalFormat(
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);
415 int GetNoiseTextureUnit();
434 bool GetBufferNeedsResolving();
452 virtual int ReadPixels(
453 const vtkRecti& rect,
int front,
int glFormat,
int glType,
void*
data,
int right = 0);
463 int CreateOffScreenFramebuffer(
int width,
int height);
469 virtual void CreateAWindow() = 0;
474 virtual void DestroyWindow() = 0;
484 void RestoreGLState();
std::set< vtkGenericOpenGLResourceFreeCallback * > Resources
int OwnContext
Flag telling if the context has been created here or was inherited.
virtual void Start()
Start the rendering process for a frame.
Wrapper around std::string to keep symbols short.
std::string OpenGLSupportMessage
virtual int GetDepthBufferSize()
This method should be defined by the subclass.
float MaximumHardwareLineWidth
virtual float * GetZbufferData(int, int, int, int)
Set/Get the zbuffer data from the frame buffer.
virtual void PopContext()
virtual unsigned char * GetPixelData(int, int, int, int, int, int=0)
Get the pixel data of an image, transmitted as RGBRGBRGB.
virtual int SetPixelData(int, int, int, int, unsigned char *, int, int=0)
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
vtkTypeUInt32 vtkMTimeType
vtkTimeStamp ContextCreationTime
manage Shader Programs within a context
void UnregisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
virtual int GetColorBufferSizes(int *)
Get the size of the color buffer.
record modification and/or execution time
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
dynamic, self-adjusting array of float
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
void Render() override
Ask each renderer owned by this RenderWindow to render its image and synchronize this process...
unsigned int FrontLeftBuffer
window superclass for vtkRenderWindow
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 void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
virtual int SetZbufferData(int, int, int, int, float *)
Set/Get the zbuffer data from the frame buffer.
a simple class to control print indentation
The VertexArrayObject class uses, or emulates, vertex array objects.
vtkTextureObject * DrawPixelsTextureObject
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 void WaitForCompletion()
Block the thread until the actual rendering is finished().
vtkOpenGLFramebufferObject * OffScreenFramebuffer
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
handles properties associated with a texture map
virtual void ReleaseRGBAPixelData(float *)
Same as Get/SetPixelData except that the image also contains an alpha component.
virtual void PushContext()
Ability to push and pop this window's context as the current context.
unsigned int DefaultFrameBufferId
Internal class which encapsulates OpenGL FramebufferObject.
vtkTextureObject * NoiseTextureObject
dynamic, self-adjusting array of unsigned char
virtual bool SetSwapControl(int)
Set the number of vertical syncs required between frames.
allocate/free texture units.
abstracts an OpenGL texture object.
virtual int SetRGBAPixelData(int, int, int, int, float *, int, int=0, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.
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.
void SetSize(int a[2]) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
virtual unsigned char * GetRGBACharPixelData(int, int, int, int, int, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.
virtual void StereoMidpoint()
Intermediate method performs operations required between the rendering of the left and right eye...
virtual void End()
Update the system, if needed, at end of render process.
virtual float * GetRGBAPixelData(int, int, int, int, int, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.
unsigned int FrontRightBuffer
vtkOpenGLBufferObject * TQuad2DVBO
virtual vtkOpenGLState * GetState()
virtual void Initialize(void)
Initialize the rendering window.
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
std::map< std::string, int > GLStateIntegers
virtual void ReleaseGraphicsResources(vtkWindow *)
Release any graphics resources that are being consumed by this texture.
virtual void Frame()
A termination method performed at the end of the rendering process to do things like swapping buffers...
The ShaderProgram uses one or more Shader objects.
virtual int SetRGBACharPixelData(int, int, int, int, unsigned char *, int, int=0, int=0)
Same as Get/SetPixelData except that the image also contains an alpha component.