offscreen buffer/bitmap/array access

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

offscreen buffer/bitmap/array access

LawsonEnglish
I've managed to work up a trivial access to the shm*   calls in Mac OS X
so that I can obtain a pointer to a shared memory buffer. How can I
render to this buffer without more c-level programming? The goal would
be to take the shared memory address and use it to build various things
like bitmaps, forms, etc. I've spent several hours rummaging around with
google and searching the various squeak-related mailing lists, but there
doesn't seem to be any Squeak way to draw to/write to an offscreen
buffer which is only defined by an external address. Certainly, with far
more work, I can devise ways to do this with FFI/plugins/etc but I'd
like to prototype in smalltalk, not C.


Lawson

Reply | Threaded
Open this post in threaded view
|

Re: offscreen buffer/bitmap/array access

David T. Lewis
On Mon, Feb 01, 2010 at 04:49:58AM -0700, Lawson English wrote:

> I've managed to work up a trivial access to the shm*   calls in Mac OS X
> so that I can obtain a pointer to a shared memory buffer. How can I
> render to this buffer without more c-level programming? The goal would
> be to take the shared memory address and use it to build various things
> like bitmaps, forms, etc. I've spent several hours rummaging around with
> google and searching the various squeak-related mailing lists, but there
> doesn't seem to be any Squeak way to draw to/write to an offscreen
> buffer which is only defined by an external address. Certainly, with far
> more work, I can devise ways to do this with FFI/plugins/etc but I'd
> like to prototype in smalltalk, not C.

The SurfacePlugin (in VMMaker package) forms the basis for a number
of plugins that do this sort of thing, and this recent posting by Josh
Gargus may be of some help:

  http://lists.squeakfoundation.org/pipermail/vm-dev/2010-January/003820.html

Dave


Reply | Threaded
Open this post in threaded view
|

Re: offscreen buffer/bitmap/array access

LawsonEnglish
David T. Lewis wrote:

> On Mon, Feb 01, 2010 at 04:49:58AM -0700, Lawson English wrote:
>  
>> I've managed to work up a trivial access to the shm*   calls in Mac OS X
>> so that I can obtain a pointer to a shared memory buffer. How can I
>> render to this buffer without more c-level programming? The goal would
>> be to take the shared memory address and use it to build various things
>> like bitmaps, forms, etc. I've spent several hours rummaging around with
>> google and searching the various squeak-related mailing lists, but there
>> doesn't seem to be any Squeak way to draw to/write to an offscreen
>> buffer which is only defined by an external address. Certainly, with far
>> more work, I can devise ways to do this with FFI/plugins/etc but I'd
>> like to prototype in smalltalk, not C.
>>    
>
> The SurfacePlugin (in VMMaker package) forms the basis for a number
> of plugins that do this sort of thing, and this recent posting by Josh
> Gargus may be of some help:
>
>   http://lists.squeakfoundation.org/pipermail/vm-dev/2010-January/003820.html
>
> Dave
>
>
>
>  
Thanks. That's exactly what I need (I hope).

It seems to me that shared buffers will also be useful for other kinds
of IPC. I've seen some reference to the Hydra VM. Does it make use of
shared memory
do you know?


Lawson

Reply | Threaded
Open this post in threaded view
|

Re: offscreen buffer/bitmap/array access

johnmci
In reply to this post by LawsonEnglish
Look at the surfacePlugin

http://www.squeakvm.org/cgi-bin/viewcvs.cgi/trunk/platforms/Cross/plugins/SurfacePlugin/
and a working xample .
http://www.squeakvm.org/cgi-bin/viewcvs.cgi/trunk/platforms/Mac%20OS/plugins/QuicktimePlugin/?rev=2148

Also you should be aware of
http://bugs.squeak.org/view.php?id=5236
which killed our usage of the QuicktimePlugin to do a surface in Sophie. However we did use the stQuicktimeSetSemaphorefor logic
so that quicktime could tell us when a frame rendered so we could pull the frame from quicktime to squeak.


On 2010-02-01, at 3:49 AM, Lawson English wrote:

> I've managed to work up a trivial access to the shm*   calls in Mac OS X so that I can obtain a pointer to a shared memory buffer. How can I render to this buffer without more c-level programming? The goal would be to take the shared memory address and use it to build various things like bitmaps, forms, etc. I've spent several hours rummaging around with google and searching the various squeak-related mailing lists, but there doesn't seem to be any Squeak way to draw to/write to an offscreen buffer which is only defined by an external address. Certainly, with far more work, I can devise ways to do this with FFI/plugins/etc but I'd like to prototype in smalltalk, not C.
>
>
> Lawson
>

--
===========================================================================
John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
===========================================================================





Reply | Threaded
Open this post in threaded view
|

Re: offscreen buffer/bitmap/array access

LawsonEnglish
Thanks John. I vaguely knew about this, but was hoping to be able to
create an offscreen surface just by passing in an ExternalAddress to an
existing squeak class.

The sample surface plugin looks like it might do as much as I need. Hrm.
More reading.

Lawson



John M McIntosh wrote:

> Look at the surfacePlugin
>
> http://www.squeakvm.org/cgi-bin/viewcvs.cgi/trunk/platforms/Cross/plugins/SurfacePlugin/
> and a working xample .
> http://www.squeakvm.org/cgi-bin/viewcvs.cgi/trunk/platforms/Mac%20OS/plugins/QuicktimePlugin/?rev=2148
>
> Also you should be aware of
> http://bugs.squeak.org/view.php?id=5236
> which killed our usage of the QuicktimePlugin to do a surface in Sophie. However we did use the stQuicktimeSetSemaphorefor logic
> so that quicktime could tell us when a frame rendered so we could pull the frame from quicktime to squeak.
>
>
> On 2010-02-01, at 3:49 AM, Lawson English wrote:
>
>  
>> I've managed to work up a trivial access to the shm*   calls in Mac OS X so that I can obtain a pointer to a shared memory buffer. How can I render to this buffer without more c-level programming? The goal would be to take the shared memory address and use it to build various things like bitmaps, forms, etc. I've spent several hours rummaging around with google and searching the various squeak-related mailing lists, but there doesn't seem to be any Squeak way to draw to/write to an offscreen buffer which is only defined by an external address. Certainly, with far more work, I can devise ways to do this with FFI/plugins/etc but I'd like to prototype in smalltalk, not C.
>>
>>
>> Lawson
>>
>>    
>
> --
> ===========================================================================
> John M. McIntosh <[hidden email]>   Twitter:  squeaker68882
> Corporate Smalltalk Consulting Ltd.  http://www.smalltalkconsulting.com
> ===========================================================================
>
>
>
>
>
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: offscreen buffer/bitmap/array access

Josh Gargus
In reply to this post by David T. Lewis
Thanks for pointing this out David.  I'm on vacation right now and have
sporadic access.  I'll be back on the 9th, and will follow up on this
thread then.  Lawson, if you have any trouble, feel free to ping me at
that time.

Cheers,
Josh

On Mon, 01 Feb 2010 07:37 -0500, "David T. Lewis" <[hidden email]>
wrote:

> On Mon, Feb 01, 2010 at 04:49:58AM -0700, Lawson English wrote:
> > I've managed to work up a trivial access to the shm*   calls in Mac OS X
> > so that I can obtain a pointer to a shared memory buffer. How can I
> > render to this buffer without more c-level programming? The goal would
> > be to take the shared memory address and use it to build various things
> > like bitmaps, forms, etc. I've spent several hours rummaging around with
> > google and searching the various squeak-related mailing lists, but there
> > doesn't seem to be any Squeak way to draw to/write to an offscreen
> > buffer which is only defined by an external address. Certainly, with far
> > more work, I can devise ways to do this with FFI/plugins/etc but I'd
> > like to prototype in smalltalk, not C.
>
> The SurfacePlugin (in VMMaker package) forms the basis for a number
> of plugins that do this sort of thing, and this recent posting by Josh
> Gargus may be of some help:
>
>   http://lists.squeakfoundation.org/pipermail/vm-dev/2010-January/003820.html
>
> Dave
>
>
--
  Joshua Gargus
  [hidden email]