Amiga!
Home
Support
Get the SDK
(Answer) (Category) Amiga Inc. Faq-O-Matic : (Category) Amiga Graphics FAQ :
How do I write directly to pixmap memory?
Is there any way to access the memory of a pixmap (getting the address for the first pixel and then write directly to that part of the memory), or has it got to be done through the copy, blit, plot, read, write tools?
bek
<answer courtesy of Daniel Adler>
1. Allocate memory for the given size of the pixmap frame buffer. 2. Open a specific pixmap instance and give it the pointer of your
   allocated memory
3. Write to the memory, and call update on the pixmap-object
example:
        qcall lib/malloc,(640*480*4:buf)
        qcall ave/avo/pix/32bit/open,(buf,640,480,640*4:pix)
cpy $FF000000,[buf] ncall pix,update,(pix:-)
<c translation by Patrick Roberts - blame me if it's wrong ;P >
       void *pix;
       unsigned int *buf;
       buf=(unsigned int *)malloc(640*480*4);
       pix=ave_avo_pix_32bit_open((void *)buf,640,480,640*4);
       
       *buf[0]=0xFF000000;
       ave_update(pix);

artix
[Append to This Answer]
Previous: (Answer) Is it possible to create 8bpp palettized pixelmaps?
Next: (Answer) Will there be a official GUI creation toolkit (something like ewinease)?
This document is: http://www.amiga.com/cgi-bin/fom.cgi?file=65
[Search] [Appearance]
This is a Faq-O-Matic 2.710.
This FAQ administered by ray@amiga.com


© 1996-2000 Amiga, Inc.