Re: Interfacing with Breve.

jon klein <[email protected]> Wed, 26 Jan 2005 09:07:09 -0500
Newsgroups gmane.comp.breve
Message-ID <[email protected]>
On Jan 26, 2005, at 8:14 AM, Junkeh wrote:

> Dear All,
>
> I am hoping to write a simple front-end to breve that simply displays 
> the
> breve image along with a few control buttons such as stop/pause.
> If I am reading this right I need to write a set of functions 
> (findMethod,
> callMethod and isSubClass) and include several structures.
>
> I'm not confident I have that point right and am also not sure how to
> proceed to the next step - is there an example I can follow or does 
> anyone
> have any pointers/tips I could follow?

The steps you describe are used to add a new "language frontend" to 
breve
so that simulations can be written in other languages.

What you want to do is create a custom "application frontend", which is
actually much easier, though the 2.0 documentation is a bit out of date.

Here's some basic code that I used recently for a custom application
frontend:

breveFrontend *frontend;
int inited = 0;

init() {
     frontend = breveFrontendInit(0, NULL);
     frontend->data = breveFrontendInitData(frontend->engine);
     frontend->engine->camera = slNewCamera(400, 400, GL_POLYGON);

     breveFrontendLoadSimulation(frontend, stevecodestring, filename);
}

iterate() {
	brEngineIterate(frontend->engine);
}

display()
     if(!inited) slInitGL(frontend->engine->world);
     inited = 1;
     brEngineRenderWorld(frontend->engine, 0);
}

Let me know if you have any questions.

- jon

_______________________________________________
breve mailing list
[email protected]
http://lists.spiderland.org/mailman/listinfo/breve