Hi Jon, Instead of just setting the texture to f, what you need to do is deallocate it. However, model-changed is not guaranteed to execute with the correct GL context. While you can call find-gl-context, pehaps there is a better way to structure this code. How about a 'texture-valid?' flag that model-changed sets to f; if it is f, then draw-gadget* gets rid of the exsting texture if there is one and makes a new texture.
Slava On Wed, May 5, 2010 at 12:21 PM, Jon Harper <[email protected]> wrote: > Hi everyone, > I'm working on displaying a video feed from a webcam. I use an > image-control (from extra/images/viewer.factor). > > I had to apply the following patch to have the control display the > video feed : http://paste.factorcode.org/paste?id=1646 > The patch is basically resetting the texture to f after each update > so that the value is not cached between calls to draw-gadget* > M: image-control model-changed > - swap value>> >>image relayout ; > + swap value>> >>image f >>texture relayout ; > > This consummes tons of memory. I tried looked at textures, but i'm puzzled : > - There are 2 textures vocabularies (basis/opengl/textures and > extra/gpu/textures). > - extra/gpu/textures has a update-texture that sounds promising > - But images.viewer uses opengl.textures > > I know nothing of low level opengl words to handle textures, so I > don't know what to do know. Should I deallocate the texture each time > or try to update the texture ? > > Thanks in advance > > Jon Harper > > ------------------------------------------------------------------------------ > _______________________________________________ > Factor-talk mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/factor-talk > ------------------------------------------------------------------------------ _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
