Text archives Help
- From: Abe Stephens <
>
- To:
- Cc:
- Subject: [Manta] Re: Re: Re: Dynamically changing rendering stack?
- Date: Thu, 18 Sep 2008 15:58:04 -0600
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=f9e7Ql/lhFQoc9YzCJSfUvNTgWyCMO5wQxXC/Aldhc5bRfbwp/MtEknq/K0UC5FWvv l5SoGnjer2CERvuTdLSYUnl1OvMqClqc2qLO5TXezcUi7jDfzgwAFSaJu5j81YyxDBYf 0u25Rzrl271JBQ5wL2o8J4PEnNTpED1M2D4S0=
On Sep 18, 2008, at 3:45 PM, Li-Ta Lo wrote:
On Thu, 2008-09-18 at 15:24 -0600, Abe Stephens wrote:
Yes, just make the change in a transaction.
Do you mean putting Factory::selectShadowAlgorithm() in a transaction?
That's one way, but you can also just use the accessors in
MantaInterface. I use a combination of the factory for the standard
components, and explicit construction for my custom components:
engine = manta_new(createManta());
engine.changeNumWorkers( num_workers );
factory = Factory( engine )
factory.selectLoadBalancer ("workqueue")
# Initialize image traverser.
traverser = manta_new( TSARImageTraverser( 64 ) );
engine.setImageTraverser( traverser );
Why does (only) Factory::selectImageType() has its own callback?
Image framebuffers in Manta are created by a callback when the engine
is running. When you send Manta a changeResolution transaction, it
deletes the old images, and then uses the callback to create new
images at the new resolution. Usually this callback just invokes the
image class constructor with the new resolution, but in some cases it
might do something special (like if the frame buffer size was
different than the renderer's resolution).
Images are the only modular component that is created on demand by the
engine--the other components can be created before the engine is
started, or updated and changed during transactions when the engine is
effectively paused.
Abe
bool Factory::selectImageType(const string& spec) const
{
string name;
vector<string> args;
parseSpec(spec, name, args);
ImageCreatorMapType::const_iterator iter = imageCreators.find(name);
if(iter == imageCreators.end())
return 0;
ImageCreator creator = iter->second;
// Create a static method callback.
manta_interface-
>
setCreateImageCallback
( Callback::create( &Factory::createImageCallback,
creator,
args ) );
return true;
}
void Factory::createImageCallback( bool stereo, int xres, int yres,
Image *& image, ImageCreator creator, vector<string> args ) {
// Invoke the legacy image creator.
image = (creator)(args, stereo, xres, yres);
}
Ollie
Archive powered by MHonArc 2.6.16.