nanogui@linuxhacker.org
On Wed, 30 Aug 2000, Greg Haerr wrote:
> : I'm trying to figure out how to use MW's engine layer as a
> : colordepth-converting framebuffer device. Specifically, how to
> : send it a rectangular 32-bit (or 24-bit) image to draw.
> For now, use a dummy psd and call GdBlit(), it will be
> extremely fast.
Okay, this seems to work. It doesn't improve speed, though.
Using GdDrawImage(), the screen would draw slowly and visibly.
What now happens is that the screen stays black for ~20 seconds,
and then the image shows up instantly.
I've probably just missed something obvious. (I've been just
guessing what needs to be done by browsing mw's source...)
What I've got, condensed, is something like this:
GdGetScreenInfo(screen, &info);
image = screen->AllocateMemGC(screen);
screen->MapMemGC(image, info.cols, info.rows, 1, 32, info.cols,
info.cols * info.rows * 4, bitmap);
image->flags = PSF_MEMORY | PSF_ADDRMALLOC;
bitmap = malloc(4 * info.rows * info.cols);
image->addr = (void *)bitmap;
fill_bitmap_with_pretty_graphics();
GdBlit(screen, 0, 0, image->xres, image->yres,
image, 0, 0, MWROP_SRCCOPY);
If it's relevant, I'm on a powerpc and compiled MW to use X11.
--
Terra Soft Solutions, Inc.
http://www.terrasoftsolutions.com/
Yellow Dog Linux
"The Ultimate Companion for a Dedicated Server"
http://www.yellowdoglinux.com/
Black Lab Linux
Advanced Workstations, Parallel, and Embedded Solutions
http://www.blacklablinux.com/