Text archives Help
- From: Carson Brownlee <
>
- To:
- Subject: [Manta] Re: Re: Re: Re: transactions in manta - setting camera
- Date: Tue, 9 Dec 2008 16:20:22 -0700
That would be an interesting system but it seems like if you had to
make all of those functions private and callable from a friended
transactions class it would be adding a lot to code complexity and
unnecessary if just creating a scene. If I'm understanding what
you're saying right I'm not sure it would work if it requires putting
calls into their own transactions, as you need to do a lot of calls in
serial. You could just do something at runtime that checks if the
system is rendering and spits out a warning to the user that their
code is bad, but that would require keeping track of or passing in a
manta_interface* to everything and unnecessary branching.
Carson
On Dec 9, 2008, at 3:49 PM, Roni Choudhury wrote:
I mentioned something like this a while back after it bit me in the
donkey. I thought it would be good to somehow make these functions
"transaction-safe only" by doing something clever with private/
protected subclassing from a function-object type and then use
friendliness to ensure that they can only be used from certain places,
but I guess it would be a major overhaul to do that.
roni
J. Davison de St. Germain wrote:
Why does setBasicCameraData() exist (or at least why is it visible)
if it 'really' shouldn't be used? If it is necessary, perhaps it
should be renamed to "setBasicCameraData_notThreadSafe()" or some
such?
Thanks,
Dav
Carson Brownlee wrote:
the difference is that the transaction will be called when manta
isn't rendering. the transaction is "safer" incase you have a
shader that is referencing camera data in parallel to the gui code
setting it. This is unlikely but possible, all calls like that
should be done in a transaction. It wouldn't be a major loss in
this case though as memory isn't being remapped, I don't think
setBasicCameraData deletes the old cameraData.
Carson
On Dec 9, 2008, at 3:37 PM, J. Davison de St. Germain wrote:
Hi,
What is the difference between:
data = manta_new(BasicCameraData(eye,lookat,up,fov,fov))
engine.getCamera(0).setBasicCameraData(data)
And creating a transaction to do the same thing?
Thanks,
Dav
Archive powered by MHonArc 2.6.16.