mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0025422: Visualization, TKOpenGl - support re-assignment of new window to existing View
Do not throw "Window already defined" exception in Visual3d_View/V3d_View. Handle window change within OpenGl_GraphicDriver::View(). OpenGl_GraphicDriver - introduce dedicated methods to initialize/release shared OpenGL context. ::InitEglContext() to using existing EGL context. OpenGl_Context - always enable NPOT textures on OpenGL ES 2.0 OpenGl_Workspace - do not call glDisable/glEnable(GL_TEXTURE_2D) on GL ES OpenGl_GraphicDriver::ReleaseContext() - release EGL context on destruction OpenGl_GraphicDriver::InitEglContext() - escape method implementation with HAVE_EGL macros OpenGl_ShaderManager - clear shader programs on shared context invalidation
This commit is contained in:
@@ -85,10 +85,6 @@ void Visual3d_View::SetWindow (const Handle(Aspect_Window)& theWindow,
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (IsDefined())
|
||||
{
|
||||
Visual3d_ViewDefinitionError::Raise ("Window already defined");
|
||||
}
|
||||
|
||||
MyCView.GContext = theContext;
|
||||
MyCView.GDisplayCB = theDisplayCB;
|
||||
@@ -106,10 +102,6 @@ void Visual3d_View::SetWindow (const Handle(Aspect_Window)& theWindow)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else if (IsDefined())
|
||||
{
|
||||
Visual3d_ViewDefinitionError::Raise ("Window already defined");
|
||||
}
|
||||
|
||||
MyWindow = theWindow;
|
||||
MyCView.WsId = MyCView.ViewId;
|
||||
@@ -159,6 +151,14 @@ void Visual3d_View::SetWindow (const Handle(Aspect_Window)& theWindow)
|
||||
// In fact, association view-window is done, but the
|
||||
// display is produced only if the view is activated (Activate).
|
||||
SetRatio();
|
||||
|
||||
// invalidate camera
|
||||
const Handle(Graphic3d_Camera)& aCamera = MyCView.Context.Camera;
|
||||
if (!aCamera.IsNull())
|
||||
{
|
||||
aCamera->InvalidateProjection();
|
||||
aCamera->InvalidateOrientation();
|
||||
}
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
|
Reference in New Issue
Block a user