Go to the documentation of this file.
25 #ifndef vtkOpenGLRenderWindow_h
26 #define vtkOpenGLRenderWindow_h
28 #include "vtkRenderingOpenGL2Module.h"
74 virtual unsigned char *
GetPixelData(
int x,
int y,
int x2,
int y2,
int front);
91 int front,
int blend=0);
93 int front,
int blend=0);
100 unsigned char *
data,
int front,
251 vtkGetMacro(FrameBufferObject,
unsigned int);
270 int numComponents,
int dataType,
void *
data);
277 int dstXmin,
int dstYmin,
int dstXmax,
int dstYmax,
278 int srcXmin,
int srcYmin,
int srcXmax,
int srcYmax,
279 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
286 int srcWidth,
int srcHeight,
int numComponents,
int dataType,
void *
data);
292 return this->MaximumHardwareLineWidth; };
311 int vtktype,
int numComponents,
312 bool needInteger,
bool needFloat);
321 return this->OpenGLSupportMessage;
346 std::set<vtkGenericOpenGLResourceFreeCallback *>
Resources;
349 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
350 = this->Resources.find(cb);
351 if (it == this->Resources.end())
353 this->Resources.insert(cb);
358 std::set<vtkGenericOpenGLResourceFreeCallback *>::iterator it
359 = this->Resources.find(cb);
360 if (it != this->Resources.end())
362 this->Resources.erase(it);
398 unsigned char*
data);
427 int OffScreenUseFrameBuffer;
433 int NumberOfFrameBuffers;
434 unsigned int TextureObjects[4];
435 unsigned int FrameBufferObject;
436 unsigned int DepthRenderBufferObject;
437 int HardwareBufferSize[2];
438 bool HardwareOffScreenBuffersBind;
475 unsigned int BackLeftBuffer;
476 unsigned int BackRightBuffer;
477 unsigned int FrontLeftBuffer;
478 unsigned int FrontRightBuffer;
479 unsigned int FrontBuffer;
480 unsigned int BackBuffer;
482 #ifndef VTK_LEGACY_REMOVE
virtual int SetPixelData(int x, int y, int x2, int y2, unsigned char *data, int front)
Set/Get the pixel data of an image, transmitted as RGBRGBRGB.
virtual vtkMTimeType GetContextCreationTime()
Get the time when the OpenGL context was created.
virtual const char * GetRenderingBackend()
What rendering backend has the user requested.
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 PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual float GetMaximumHardwareLineWidth()
Return the largest line width supported by the hardware.
void RegisterGraphicsResources(vtkGenericOpenGLResourceFreeCallback *cb)
virtual int SetZbufferData(int x1, int y1, int x2, int y2, float *buffer)
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.
virtual int GetZbufferData(int x1, int y1, int x2, int y2, float *z)
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.
virtual int SetPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front)
dynamic, self-adjusting array of float
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, float *data, int front, int blend=0)
std::map< const vtkTextureObject *, int > TextureResourceIds
virtual int SetUseOffScreenBuffers(bool offScreen)
Create and bind offscreen rendering buffers without destroying the current OpenGL context.
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 SetTextureUnitManager(vtkTextureUnitManager *textureUnitManager)
Set the texture unit manager.
dynamic, self-adjusting array of unsigned char
virtual int SupportsOpenGL()
Does this render window support OpenGL? 0-false, 1-true.
void BindHardwareOffScreenBuffers()
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 GetBackLeftBuffer()
Return the OpenGL name of the back left buffer.
virtual int SetRGBACharPixelData(int x, int y, int x2, int y2, unsigned char *data, int front, int blend=0)
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...
virtual int GetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *z)
virtual int SetRGBACharPixelData(int x, int y, int x2, int y2, vtkUnsignedCharArray *data, int front, int blend=0)
virtual void PopContext()
void SetContextSupportsOpenGL32(bool val)
virtual unsigned char * GetRGBACharPixelData(int x, int y, int x2, int y2, int front)
vtkTypeUInt64 vtkMTimeType
void SaveGLState()
Query and save OpenGL state.
virtual float * GetZbufferData(int x1, int y1, int x2, int y2)
Set/Get the zbuffer data from an image.
int GetRGBAPixelData(int x, int y, int x2, int y2, int front, float *data)
handles properties associated with a texture map
allocate/free texture units.
vtkOpenGLShaderCache * ShaderCache
virtual void WaitForCompletion()
Block the thread until the actual rendering is finished().
virtual int GetPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data)
void DeactivateTexture(vtkTextureObject *)
Deactive a previously activated texture.
int GetTextureUnitForTexture(vtkTextureObject *)
Get the texture unit for a given texture object.
virtual unsigned char * GetPixelData(int x, int y, int x2, int y2, int front)
Set/Get the pixel data of an image, transmitted as RGBRGB...
virtual void OpenGLInitState()
The ShaderProgram uses one or more Shader objects.
virtual void OpenGLInitContext()
a simple class to control print indentation
abstracts an OpenGL texture object.
static bool GetContextSupportsOpenGL32()
Get if the context includes opengl core profile 3.2 support.
virtual void StereoUpdate()
Update system if needed due to stereo rendering.
unsigned int GetFrontBuffer()
Return the OpenGL name of the front left buffer.
list of point or cell ids
int GetDefaultTextureInternalFormat(int vtktype, int numComponents, bool needInteger, bool needFloat)
Get a mapping of vtk data types to native texture formats for this window we put this on the RenderWi...
virtual int SetZbufferData(int x1, int y1, int x2, int y2, vtkFloatArray *buffer)
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...
void RestoreGLState()
Restore OpenGL state at end of the rendering.
unsigned int GetFrontLeftBuffer()
Return the OpenGL name of the front left buffer.
int CreateHardwareOffScreenBuffers(int width, int height, bool bind=false)
unsigned int GetFrontRightBuffer()
Return the OpenGL name of the front right buffer.
virtual float * GetRGBAPixelData(int x, int y, int x2, int y2, int front)
Set/Get the pixel data of an image, transmitted as RGBARGBA...
virtual bool GetUseOffScreenBuffers()
virtual void MakeCurrent()=0
Attempt to make this window the current graphics context for the calling thread.
virtual int GetPixelData(int x, int y, int x2, int y2, int front, unsigned char *data)
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.
void InitializeTextureInternalFormats()
static int GetGlobalMaximumNumberOfMultiSamples()
std::map< std::string, int > GLStateIntegers
int GetColorBufferSizes(int *rgba)
Get the size of the color buffer.
virtual void SetSize(int, int)
virtual void ReleaseRGBAPixelData(float *data)
int GetDepthBufferSize()
Get the size of the depth buffer.
create a window for renderers to draw into
Wrapper around std::string to keep symbols short.
virtual int GetRGBAPixelData(int x, int y, int x2, int y2, int front, vtkFloatArray *data)
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.
virtual int SetRGBAPixelData(int x, int y, int x2, int y2, vtkFloatArray *data, int front, int blend=0)
The VertexArrayObject class uses, or emulates, vertex array objects.
virtual int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, vtkUnsignedCharArray *data)
virtual void Initialize(void)
Initialize the rendering window.
virtual void CreateAWindow()=0
Create a not-off-screen window.
unsigned int LastGraphicError
int GetRGBACharPixelData(int x, int y, int x2, int y2, int front, unsigned char *data)
virtual void SetSize(int a[2])
Set the size of the window in screen coordinates in pixels.