On Oct 18, 2009, at 9:46 AM, Ed Swartz wrote: > For my specific needs, I'm slowly learning GLSL and using the very > convenient gpu.shaders vocabulary with GLSL-SHADER to make shaders > embedded in Factor source. I have some tuples which reference shader > programs and apply them when drawing a scene. But I'd like to see if > it's possible to reload/recompile/relink those shaders when I refresh > the vocabulary that defines them, so I can quickly explore the effects > of my changes. Currently I have to restart my program to do this.
There's a refresh-program word in gpu.shaders that will try to recompile and relink the shaders for a GLSL-PROGRAM: definition. After you reload your source code, do «your-program-name refresh-program» . I thought about making this automatic, but I'm not sure it would be robust. As far as I know, there's no way to hook "refresh-all" to pick up shader sources stored in files separate from the factor source. > And, in a simpler case, the GL scene itself is defined as a data > structure but created at init time with code. So again I have to > restart my program to test changes. Would there be a way to hook > things > so I can recreate my scene when I refresh the word or vocabulary that > defines the scene? There's a word "add-definition-observer" in compiler.units that lets you register an object to have its "definitions-changed" method called whenever definitions are added or changed. You can look at tools.deprecation for a simple example of how it works. -Joe ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
