if( attri_tail->TransPers.mode != node->TransPers.mode ||
attri_tail->TransPers.pointX != node->TransPers.pointX ||
attri_tail->TransPers.pointY != node->TransPers.pointY ||
- attri_tail->TransPers.pointZ != node->TransPers.pointX )
+ attri_tail->TransPers.pointZ != node->TransPers.pointZ )
{
transform_persistence_begin( attri_tail->TransPers.mode,
#include <OpenGl_tgl_util.hxx>
#include <OpenGl_Memory.hxx>
#include <OpenGl_graduatedtrihedron.hxx>
+#include <OpenGl_ResourceCleaner.hxx>
+#include <OpenGl_ResourceTexture.hxx>
/*----------------------------------------------------------------------*/
/*
call_subr_close_ws( CALL_DEF_VIEW * aview )
{
CMN_KEY_DATA key;
+ CMN_KEY_DATA textureKey;
+
+ TsmGetWSAttri( aview->WsId, WSWindow, &key );
+
#ifdef OCC1188
tsm_bg_texture texture;
+ WINDOW aWnd = (WINDOW) key.ldata;
- TsmGetWSAttri( aview->WsId, WSBgTexture, &key );
- texture = (tsm_bg_texture)key.pdata;
-
- if( texture == 0 )
- return;
+ TsmGetWSAttri( aview->WsId, WSBgTexture, &textureKey );
+ texture = (tsm_bg_texture)textureKey.pdata;
- if ( texture->texId != 0 )
- glDeleteTextures( 1,(GLuint *)&(texture->texId) );
+ if ( texture != 0 && texture->texId != 0 )
+ {
+ OpenGl_ResourceCleaner* anCleaner = OpenGl_ResourceCleaner::GetInstance();
+
+ // Delete the texture with ResourceCleaner; if it is not possible
+ // do this directly with proper context selected
+ if ( !anCleaner->AddResource( TxglGetContext(aWnd),
+ new OpenGl_ResourceTexture(texture->texId) ) )
+ {
+ GLCONTEXT cur_context = GET_GL_CONTEXT();
+ GLDRAWABLE cur_drawable = GET_GLDEV_CONTEXT();
+
+ if ( TxglWinset( call_thedisplay, aWnd ) == TSuccess )
+ glDeleteTextures( 1,(GLuint *)&(texture->texId) );
+
+ // activate the previous context for this thread
+ GL_MAKE_CURRENT( call_thedisplay, cur_drawable, cur_context );
+ }
+ }
+
#endif
- TsmGetWSAttri( aview->WsId, WSWindow, &key );
#ifdef RIC120302
if( !aview->GContext )
#endif
call_togl_redraw_layer2d (aview, anunderlayer);
}
call_func_redraw_all_structs_proc (aview->WsId);
+ call_subr_displayCB (aview, OCC_REDRAW_WINDOW | OCC_PRE_OVERLAY);
if (anoverlayer->ptrLayer)
{
call_togl_redraw_layer2d (aview, anoverlayer);
call_togl_redraw_layer2d (aview, anunderlayer);
}
call_func_redraw_all_structs_proc (aview->WsId);
+ call_subr_displayCB (aview, OCC_REDRAW_WINDOWAREA | OCC_PRE_OVERLAY);
if (anoverlayer->ptrLayer)
{
call_togl_redraw_layer2d (aview, anoverlayer);
/* recover display lists from dead_ctx, then destroy it */
ctx = glXCreateContext( disp, vis, dead_ctx, GL_TRUE );
glXDestroyContext(dead_dpy, dead_ctx);
- dead_ctx = 0;
} else if (previous_ctx == 0) {
ctx = glXCreateContext( disp, vis, NULL, GL_TRUE );
} else {
}
previous_ctx = ctx;
- if( !ctx) return TFailure;
+ if( ctx )
+ OpenGl_ResourceCleaner::GetInstance()->AppendContext( ctx, true );
- OpenGl_ResourceCleaner::GetInstance()->AppendContext( ctx, true );
+ // remove the dead_ctx for ResourceCleaner after appending shared ctx
+ if (dead_ctx) {
+ OpenGl_ResourceCleaner::GetInstance()->RemoveContext(dead_ctx);
+ dead_ctx = 0;
+ }
+
+ if( !ctx) return TFailure;
cmap = XCreateColormap( disp, par, vis->visual, AllocNone );
/* FSXXX sync necessary if non-direct rendering */
glXWaitGL();
- OpenGl_ResourceCleaner::GetInstance()->RemoveContext( ctx );
_Txgl_Map.UnBind( win );
if (previous_ctx == ctx) {
* losing any shared display lists (fonts...)
*/
if (previous_ctx) {
+ OpenGl_ResourceCleaner::GetInstance()->RemoveContext(ctx);
glXDestroyContext(disp, ctx);
} else {
dead_ctx = ctx;
dead_dpy = disp;
}
} else {
+ OpenGl_ResourceCleaner::GetInstance()->RemoveContext(ctx);
glXDestroyContext(disp, ctx);
}