Stuart Axon
2010-05-04 22:42:23 UTC
Hi,
I've been working on a toy implementation of shoebot, to try out a few things I've mentioned on the mailinglist.
It's semi from scratch (checking shoebot and nodebox code where possible).
******************************************************************************
My mac isn't working, if anybody can think of some test cases for CORNER/
CENTER and get some screenshots from nodebox on the mac, it'd be really good.
******************************************************************************
I think I can get both transform modes working, but I might be completely wrong :)
- Having asked the cairo list and looked at nodebox-javas source.
I've commited the sin of premature optimisation with this - everything is built in ways
I think *should* be faster, but I won't know until almost everything is working.
Fixes so far:
size(), background(). Can be called anywhere, only the last time actually matters
background() - is not affected by transforms (in shoebot try rotating then doing background)
size() can take variables
bot is always only run once per frame
Performance:
Drawing model:
Draw commands are returned as functions (closures), which are
added to a queue.
After the bot has run a frame, each command on the queue is called,
passed the context to act on.
I try and avoid if/elif blocks in favour of function references wherever possible
PathElements are only created when requested
Future performance:
Since running the bot and rendering is seperate, I'm wondering whether this could happen in different
threads (or even have more than one rendering thread).
PyPy - The next release will be able to run C Extensions, hopefully whichever version of shoebot will too.
API:
Where possible I'm trying to not add anything to the public API that isn't in nodebox, e.g. Bot.run is avoided
Will it work?
I hope so
Once I get everything working I'll try and merge back into a branch of shoebot
(right now everything is in a single file).
S++
I've been working on a toy implementation of shoebot, to try out a few things I've mentioned on the mailinglist.
It's semi from scratch (checking shoebot and nodebox code where possible).
******************************************************************************
My mac isn't working, if anybody can think of some test cases for CORNER/
CENTER and get some screenshots from nodebox on the mac, it'd be really good.
******************************************************************************
I think I can get both transform modes working, but I might be completely wrong :)
- Having asked the cairo list and looked at nodebox-javas source.
I've commited the sin of premature optimisation with this - everything is built in ways
I think *should* be faster, but I won't know until almost everything is working.
Fixes so far:
size(), background(). Can be called anywhere, only the last time actually matters
background() - is not affected by transforms (in shoebot try rotating then doing background)
size() can take variables
bot is always only run once per frame
Performance:
Drawing model:
Draw commands are returned as functions (closures), which are
added to a queue.
After the bot has run a frame, each command on the queue is called,
passed the context to act on.
I try and avoid if/elif blocks in favour of function references wherever possible
PathElements are only created when requested
Future performance:
Since running the bot and rendering is seperate, I'm wondering whether this could happen in different
threads (or even have more than one rendering thread).
PyPy - The next release will be able to run C Extensions, hopefully whichever version of shoebot will too.
API:
Where possible I'm trying to not add anything to the public API that isn't in nodebox, e.g. Bot.run is avoided
Will it work?
I hope so
Once I get everything working I'll try and merge back into a branch of shoebot
(right now everything is in a single file).
S++