1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0031457: Visualization - interface to find an active frame buffer

This commit is contained in:
nds
2020-03-21 20:13:55 +03:00
parent a516227511
commit e5b2dec838
2 changed files with 15 additions and 0 deletions

View File

@@ -916,6 +916,18 @@ public: //! @name methods to alter or retrieve current state
//! Bind default Vertex Array Object
Standard_EXPORT void BindDefaultVao();
//! Active Frame Buffer Object.
const Handle(OpenGl_FrameBuffer)& ActiveFrameBuffer() const
{
return myActiveFbo;
}
//! Setup Active Frame Buffer Object.
Standard_EXPORT void SetActiveFrameBuffer (const Handle(OpenGl_FrameBuffer)& theFbo)
{
myActiveFbo = theFbo;
}
//! Default Frame Buffer Object.
const Handle(OpenGl_FrameBuffer)& DefaultFrameBuffer() const
{
@@ -1173,6 +1185,7 @@ private: //! @name fields tracking current state
//!< currently active sampler objects
Standard_Integer myActiveMockTextures; //!< currently active mock sampler objects
Handle(OpenGl_FrameBuffer) myDefaultFbo; //!< default Frame Buffer Object
Handle(OpenGl_FrameBuffer) myActiveFbo; //!< active Frame Buffer Object
Handle(OpenGl_LineAttributes) myHatchStyles; //!< resource holding predefined hatch styles patterns
Standard_Integer myActiveHatchType; //!< currently activated type of polygon hatch
Standard_Boolean myHatchIsEnabled; //!< current enabled state of polygon hatching rasterization

View File

@@ -692,6 +692,8 @@ void OpenGl_FrameBuffer::BindBuffer (const Handle(OpenGl_Context)& theGlCtx)
{
theGlCtx->arbFBO->glBindFramebuffer (GL_FRAMEBUFFER, myGlFBufferId);
theGlCtx->SetFrameBufferSRGB (true);
theGlCtx->SetActiveFrameBuffer (this);
}
// =======================================================================