mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +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:
@@ -199,6 +199,23 @@ OpenGl_Context::~OpenGl_Context()
|
||||
#endif
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : forcedRelease
|
||||
// purpose :
|
||||
// =======================================================================
|
||||
void OpenGl_Context::forcedRelease()
|
||||
{
|
||||
ReleaseDelayed();
|
||||
for (NCollection_DataMap<TCollection_AsciiString, Handle(OpenGl_Resource)>::Iterator anIter (*mySharedResources);
|
||||
anIter.More(); anIter.Next())
|
||||
{
|
||||
anIter.Value()->Release (this);
|
||||
}
|
||||
mySharedResources->Clear();
|
||||
myShaderManager->clear();
|
||||
myShaderManager->SetContext (NULL);
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// function : MaxDegreeOfAnisotropy
|
||||
// purpose :
|
||||
@@ -878,8 +895,12 @@ void OpenGl_Context::init()
|
||||
|
||||
hasTexRGBA8 = IsGlGreaterEqual (3, 0)
|
||||
|| CheckExtension ("GL_OES_rgb8_rgba8");
|
||||
arbNPTW = IsGlGreaterEqual (3, 0)
|
||||
|| CheckExtension ("GL_OES_texture_npot");
|
||||
// NPOT textures has limited support within OpenGL ES 2.0
|
||||
// which are relaxed by OpenGL ES 3.0 or some extensions
|
||||
//arbNPTW = IsGlGreaterEqual (3, 0)
|
||||
// || CheckExtension ("GL_OES_texture_npot")
|
||||
// || CheckExtension ("GL_NV_texture_npot_2D_mipmap");
|
||||
arbNPTW = Standard_True;
|
||||
arbTexRG = IsGlGreaterEqual (3, 0)
|
||||
|| CheckExtension ("GL_EXT_texture_rg");
|
||||
extBgra = CheckExtension ("GL_EXT_texture_format_BGRA8888");
|
||||
|
Reference in New Issue
Block a user