[fluxus] 0.12b1 + cvs merge

Claude Heiland-Allen claudiusmaximus at goto10.org
Fri Jan 12 08:40:42 PST 2007


Dave Griffiths wrote:
>> How language-agnostic is Fluxus' core?
> 
> libfluxus is completely agnostic, and that is where all the useful
> graphics code is. I was using libfluxus for a while as an engine for a
> game I was writing entirely in C++ a few years ago.

Cool.

> I don't think I'd want any more language bindings in the main fluxus cvs -

Sure.

> but I briefly had a python version working, it's not hard to do, and I'd
> be very happy to support the core graphics functions for other projects
> using libfluxus.

Sounds more than reasonable :)

 > We could put a new target in to install it as a dynamic
> lib.

That would be great!

But, I was thinking more about the editor and the every-frame stuff, 
which are what makes Fluxus be Fluxus for me.

Especially being able to type code fragments, evaluate them, and change 
the every-frame hook on the fly, and which seem to be defined elsewhere 
that libfluxus from my cursory glances.

>> In hsext [2] I call C functions from Haskell and call Haskell functions
>> from C, both directions using the C ABI.  Haskell has a mechanism for
>> wrapping a Haskell function into a C function pointer at runtime, if
>> Scheme has something like this and Fluxus uses this to call Scheme code,
>> it should be (relatively) easy to add Haskell support.
 >
> I don't know haskell at all, but I think it would be easier to go direct
> to libfluxus than worry about the scheme interface.

Well, it's more a case of Haskell being able to generate a C function 
pointer, and call C code with that function pointer as an argument, with 
a use-case in mind of "register a callback".

In the case of every-frame, the implementation of every-frame would be 
something like

----8<----
// type of the callback function
typedef void (everyframecallback_f)(fluxusstate_t *);

// store the current callback
static everyframecallback_f *everyframecallback;

// register a callback (called from Scheme, Python, Haskell, etc)
extern void registereveryframecallback(everyframecallback_f *callback) {
     everframecallback = callback;
}

// call the callback
void everyframe(void) {
     if (everyframecallback != NULL) {
         (*everyframecallback)(globalfluxusstate);
     }
}
----8<----

and not something like

----8<----
...

void everyframe(void) {
     if (everyframecallback != NULL) {
         scheme_call(everyframecallback, globalfluxusstate);
     }
}
----8<----


>> [1] Here's a thingy I made using Haskell + OpenGL + my nD stuff:
>> http://claudiusmaximus.goto10.org/files/coding/polytopiary/cube-4d-01.gif
> 
> cool - is the code anywhere for curious eyes? :)

http://devel.goto10.org/filedetails.php?repname=maximus&path=%2Fpolytopiary%2Fvisualisations%2FPolytopiary.lhs&rev=0&sc=0



Claude





More information about the Fluxus mailing list