D3DHost_FrameBuffer - added missing color texture release within FBO destruction.
OpenGl_View::RedrawImmediate() - fixed unexpected window buffer swap while rendering into offscreen myFBO.
return Standard_False;
}
+ myIsOwnColor = true;
myColorTextures (0)->Release (theCtx.operator->());
myColorTextures (0)->Create (theCtx);
// =======================================================================
D3DHost_View::~D3DHost_View()
{
- if (!myD3dWglFbo.IsNull())
- {
- myD3dWglFbo->Release (myWorkspace->GetGlContext().operator->());
- myD3dWglFbo.Nullify();
- }
+ ReleaseGlResources (NULL);
if (myD3dDevice != NULL)
{
myD3dDevice->Release();
}
}
+// =======================================================================
+// function : ReleaseGlResources
+// purpose :
+// =======================================================================
+void D3DHost_View::ReleaseGlResources (const Handle(OpenGl_Context)& theCtx)
+{
+ if (!myD3dWglFbo.IsNull())
+ {
+ myD3dWglFbo->Release (theCtx.get());
+ myD3dWglFbo.Nullify();
+ }
+ OpenGl_View::ReleaseGlResources (theCtx);
+}
+
// =======================================================================
// function : D3dColorSurface
// purpose :
//! Default destructor.
Standard_EXPORT virtual ~D3DHost_View();
+ //! Release OpenGL resources.
+ Standard_EXPORT virtual void ReleaseGlResources (const Handle(OpenGl_Context)& theCtx) Standard_OVERRIDE;
+
//! Creates and maps rendering window to the view.
//! @param theWindow [in] the window.
//! @param theContext [in] the rendering context. If NULL the context will be created internally.
Standard_True) || toSwap;
if (aStereoMode == Graphic3d_StereoMode_SoftPageFlip
&& toSwap
+ && myFBO.get() == NULL
&& !aCtx->caps->buffersNoSwap)
{
aCtx->SwapBuffers();
aCtx->ShaderManager()->PushState (Handle(OpenGl_ShaderProgram)());
}
- if (toSwap && !aCtx->caps->buffersNoSwap)
+ if (toSwap
+ && myFBO.get() == NULL
+ && !aCtx->caps->buffersNoSwap)
{
aCtx->SwapBuffers();
}
Standard_EXPORT virtual ~OpenGl_View();
//! Release OpenGL resources.
- Standard_EXPORT void ReleaseGlResources (const Handle(OpenGl_Context)& theCtx);
+ Standard_EXPORT virtual void ReleaseGlResources (const Handle(OpenGl_Context)& theCtx);
//! Deletes and erases the view.
Standard_EXPORT virtual void Remove() Standard_OVERRIDE;