hmm... i'm not very proud of this solution, i know it is quite rude, but 
seems to work anyways...

void destroyGL()
{
     for ( GLuint i=0; i<numberOfObjects ; i++ )
     {
        // delete geometries
         if ( glIsList( i ) )
             glDeleteLists( i , 1 );

        // delete textures
         if ( glIsTexture( i ) )
             glDeleteTextures( 1, &i );

        // delete SHL shaders
         deleteObject( i );
     }
}

i call it after making the auxiliary context current.

numberOfObjects can be calculated with a traverse, or can be a number 
reasonably high.

this releases opengl resources. if opensg needs them again, i think they 
get created with the next validateGlObjects on the context's window...

hope it helps

francesco



Carsten Neumann ha scritto:
>       Hello Francesco,
> 
> Francesco Tamagni wrote:
>> i solved destroying manually opengl display lists, textures and shader 
>> objects present in the context. not a brilliant solution, but seems to 
>> work, without annoying opensg too much ;)
> 
> I'm happy to hear that you found a solution and wanted to apologize for 
> only replying now that your problem is solved, but off-hand I did not 
> have a good solution when I saw your mail yesterday and had not found 
> the time to take a closer look since.
> However, I'm curious, would you mind describing your solution a bit? It 
> would also be valuable for anyone looking at a similar problem in the 
> future.
> 
>       Thank you,
>               Carsten
> 
> 
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to