[squeak-dev] Re: [Pharo-project] Offscreen drawing...

Andreas Raab andreas.raab at gmx.de
Tue Aug 25 03:40:31 UTC 2009


Lawson English wrote:
> It would be very kool to have Squeak/Croquet able to render into SL the 
> same way. Smalltalk on a prim...

This is actually utterly trivial. What you are looking for is in the 
SurfacePlugin. It allows to map external bitmaps into Squeak and to draw 
directly into it. The B3D engine uses this to do mixed-mode rendering in 
Direct3D; i.e., exposing the D3D rendering target to drawing operations 
in Squeak.

Example code for the surface plugin can be found here:

http://squeakvm.org/svn/squeak/trunk/platforms/Cross/plugins/ExampleSurfacePlugin/

The example uses a malloc()ed region of memory; you can use shared mem 
or whatever. Once you've created a form in this way all you need is to 
just BitBlt right onto it, or even better, just set it as Squeak's 
Display variable and all drawing will go onto it.

Cheers,
   - Andreas



More information about the Squeak-dev mailing list