Hello Antonio,

Antonio Bleile wrote:
> Each time we render a preview, we recreate
>  the geometry

why that?

> on which we apply the material.
> We observed, that doing this in an endless loop
> saturates the memory:
> We figured out that disabling the creation of the
> Displaylist solved the problem:
> 
> setDlistCache(false);
> 
> So, I'm not sure whether this is a bug or a feature,
> the ddlists apparently get never freed, although the
> corresponding geometry has been deleted!

The problem here is that the Dlists have to be destroyed with the 
correct context active, so it can not be done directly in the Geometry 
destructor.
 From a quick look at the code Geometry marks it's Dlist as unused, but 
the actual destruction is part of Window::frameExit, so changing your 
loop to:

 > while( true )
 > {
 >     load geometry;
 >
 >     apply material
 >
 >     render
 >
 >     destroy geometry

       render // just an empty scene, basically to get Window to call
              // frameExit
 > }

should actually destroy them.

IIUC you are recreating the geometry and rendering it just once to get 
an image that shows the material, so you likely want the Dlists off 
anyways as it only slows down the single rendering.

> If you need a small demo reproducing the effect, I'll
> compile something for you to test, but I just want to
> know if anybody can explain what "setDllistCache"
> implies (the manual just states "turns off ddlist creation",
> but the term "Cache" confuses me :)

It turns off Dlist creation.

        Hope it helps,
                Carsten

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to