63#ifndef vtkOpenGLState_h
64#define vtkOpenGLState_h
67#include "vtkRenderingOpenGL2Module.h"
97 void vtkglColorMask(
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a);
104 this->vtkglBlendFuncSeparate(sfactor, dfactor, sfactor, dfactor);
107 unsigned int sfactorAlpha,
unsigned int dfactorAlpha);
123 unsigned int face,
unsigned int sfail,
unsigned int dpfail,
unsigned int dppass);
124 void vtkglStencilOp(
unsigned int sfail,
unsigned int dpfail,
unsigned int dppass);
184 template <
typename T>
190 ((*this->State).*(this->Method))(this->Value);
225 this->PushDrawFramebufferBinding();
226 this->PushReadFramebufferBinding();
233 this->PopReadFramebufferBinding();
234 this->PopDrawFramebufferBinding();
294 this->State->vtkglGetBooleanv(name, &val);
295 this->Value = val == 1;
299 this->State->SetEnumState(this->Name, this->Value);
342 int vtktype,
int numComponents,
bool needInteger,
bool needFloat,
bool needSRGB);
431 unsigned int DrawBuffers[10];
a simple class to control print indentation
abstract base class for most VTK objects
Internal class which encapsulates OpenGL FramebufferObject.
manage Shader Programs within a context
unsigned int GetDrawBuffer(unsigned int)
unsigned int GetBinding()
unsigned int GetReadBuffer()
int BoundElementArrayBuffer
BufferBindingState ReadBinding
BufferBindingState DrawBinding
unsigned int BlendEquationValue1
std::array< unsigned int, 4 > BlendFunc
unsigned int StencilMaskFront
unsigned int StencilMaskBack
std::array< unsigned int, 3 > StencilFuncFront
std::array< unsigned char, 4 > ColorMask
std::array< unsigned int, 3 > StencilFuncBack
unsigned int CullFaceMode
unsigned int BlendEquationValue2
std::array< int, 4 > Viewport
std::array< unsigned int, 3 > StencilOpFront
std::array< int, 4 > Scissor
std::array< float, 4 > ClearColor
std::array< unsigned int, 3 > StencilOpBack
unsigned int ActiveTexture
ScopedglActiveTexture(vtkOpenGLState *state)
ScopedglBlendFuncSeparate(vtkOpenGLState *state)
ScopedglClearColor(vtkOpenGLState *state)
ScopedglColorMask(vtkOpenGLState *state)
ScopedglDepthFunc(vtkOpenGLState *state)
ScopedglDepthMask(vtkOpenGLState *state)
ScopedglEnableDisable(vtkOpenGLState *state, unsigned int name)
ScopedglScissor(vtkOpenGLState *state)
ScopedglViewport(vtkOpenGLState *state)
void Scissor(std::array< int, 4 > val)
void vtkglViewport(int x, int y, int width, int height)
void vtkReadBuffer(unsigned int, vtkOpenGLFramebufferObject *)
void vtkglLineWidth(float)
void vtkglGetIntegerv(unsigned int pname, int *params)
bool GetEnumState(unsigned int name)
void vtkglStencilOpSeparate(unsigned int face, unsigned int sfail, unsigned int dpfail, unsigned int dppass)
void vtkDrawBuffers(unsigned int n, unsigned int *, vtkOpenGLFramebufferObject *)
void CheckState()
Check that this OpenGL state has consistent values with the current OpenGL context.
std::list< BufferBindingState > DrawBindings
void ResetGLBlendEquationState()
void ResetGLScissorState()
void SetVBOCache(vtkOpenGLVertexBufferObjectCache *val)
void vtkglActiveTexture(unsigned int)
std::string const & GetRenderer()
Return the opengl renderer for this context.
void vtkBindFramebuffer(unsigned int target, vtkOpenGLFramebufferObject *fo)
void Initialize(vtkOpenGLRenderWindow *)
Initialize OpenGL context using current state.
vtkOpenGLShaderCache * ShaderCache
void ResetGLActiveTexture()
void vtkglStencilFuncSeparate(unsigned int face, unsigned int func, int ref, unsigned int mask)
std::map< const vtkTextureObject *, int > TextureResourceIds
void PopFramebufferBindings()
Store/Restore the current framebuffer bindings and buffers.
void ResetEnumState(unsigned int name)
convenience method to reset an enum state from current openGL context
~vtkOpenGLState() override
void ColorMask(std::array< unsigned char, 4 > val)
void PopDrawFramebufferBinding()
Store/Restore the current framebuffer bindings and buffers.
void SetTextureUnitManager(vtkTextureUnitManager *textureUnitManager)
Set the texture unit manager.
void vtkglDrawBuffers(unsigned int n, unsigned int *)
void vtkglCullFace(unsigned int val)
void Viewport(std::array< int, 4 > val)
void vtkglReadBuffer(unsigned int)
void vtkglBlendFuncSeparate(unsigned int sfactorRGB, unsigned int dfactorRGB, unsigned int sfactorAlpha, unsigned int dfactorAlpha)
void vtkglBindFramebuffer(unsigned int target, unsigned int fb)
void ResetGLDepthMaskState()
void ActivateTexture(vtkTextureObject *)
Activate a texture unit for this texture.
void Push()
Push all the recorded state onto the stack.
void vtkglDisable(unsigned int cap)
static vtkOpenGLState * New()
void vtkglGetDoublev(unsigned int pname, double *params)
void ResetGLDepthFuncState()
void vtkglStencilOp(unsigned int sfail, unsigned int dpfail, unsigned int dppass)
void Pop()
Pop the state stack to restore a previous state.
void BlendFuncSeparate(std::array< unsigned int, 4 > val)
void vtkglBlendFunc(unsigned int sfactor, unsigned int dfactor)
void vtkglEnable(unsigned int cap)
void PushFramebufferBindings()
Store/Restore the current framebuffer bindings and buffers.
void ResetGLClearDepthState()
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 Reset()
Record the OpenGL state into this class.
std::stack< GLState > Stack
void vtkglStencilMaskSeparate(unsigned int face, unsigned int mask)
void vtkglClearDepth(double depth)
void ResetGLColorMaskState()
void PopReadFramebufferBinding()
Store/Restore the current framebuffer bindings and buffers.
void vtkglDrawBuffer(unsigned int)
void InitializeTextureInternalFormats()
std::string const & GetVersion()
Return the opengl version for this context.
std::string const & GetVendor()
Return the opengl vendor for this context.
void vtkglGetFloatv(unsigned int pname, float *params)
void GetCurrentDrawFramebufferState(unsigned int &drawBinding, unsigned int &drawBuffer)
Get the current stored state of the draw buffer and binding.
void vtkglBlitFramebuffer(int, int, int, int, int, int, int, int, unsigned int, unsigned int)
Perform a blit but handle some driver bugs safely.
void PushReadFramebufferBinding()
Store/Restore the current framebuffer bindings and buffers.
void vtkglScissor(int x, int y, int width, int height)
void VerifyNoActiveTextures()
Check to make sure no textures have been left active.
void vtkglColorMask(unsigned char r, unsigned char g, unsigned char b, unsigned char a)
void vtkglDepthMask(unsigned char flag)
vtkTextureUnitManager * GetTextureUnitManager()
Returns its texture unit manager object.
void vtkglPointSize(float)
void vtkglBlendEquationSeparate(unsigned int col, unsigned int alpha)
void vtkglClearColor(float red, float green, float blue, float alpha)
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void DeactivateTexture(vtkTextureObject *)
Deactivate a previously activated texture.
std::list< BufferBindingState > ReadBindings
void vtkglDepthFunc(unsigned int val)
void PushDrawFramebufferBinding()
Store/Restore the current framebuffer bindings and buffers.
void vtkglClear(unsigned int mask)
void SetEnumState(unsigned int name, bool value)
void vtkglPixelStorei(unsigned int, int)
void ResetGLViewportState()
void ResetGLClearColorState()
void ClearColor(std::array< float, 4 > val)
void vtkglBlendEquation(unsigned int val)
void ResetGLCullFaceState()
void vtkglGetBooleanv(unsigned int pname, unsigned char *params)
void ResetFramebufferBindings()
Store/Restore the current framebuffer bindings and buffers.
vtkOpenGLVertexBufferObjectCache * VBOCache
void ResetGLBlendFuncState()
void vtkglStencilFunc(unsigned int func, int ref, unsigned int mask)
void GetBlendFuncState(int *)
int GetTextureUnitForTexture(vtkTextureObject *)
Get the texture unit for a given texture object.
vtkTextureUnitManager * TextureUnitManager
void vtkglStencilMask(unsigned int mask)
manage vertex buffer objects shared within a context
abstracts an OpenGL texture object.
allocate/free texture units.
boost::graph_traits< vtkGraph * >::vertex_descriptor target(boost::graph_traits< vtkGraph * >::edge_descriptor e, vtkGraph *)
#define VTK_UNICODE_STRING