RE: I need a full tutorial!!

Search this archive.

From: Jay Link (jlink@ilbbs.com)
Date: Tue 06 Feb 2001 - 16:06:27 IST


> How about moving pixels between contexts of differing size?

I don't think that's an issue. If you're going from virtual to real, or
vice-versa, look at gl_copyboxfromcontext() and gl_copyboxtocontext().
(from is better). If you're using from, then set the destination as the
current context first.

Also, you can create a memory buffer, and then use gl_getbox() and
gl_putbox() to transfer to and from that. Or, you can take am image (or
series of pixels) from one context, put it in the buffer, and then paste
it into another context, which works just like gl's internal buffer /
virtual context.

To create the home-brewed memory buffer, just create a variable of type
char or void and make it of size width * height * BYTESPERPIXEL:

   void buffer[w * h * BYTESPERPIXEL];

   ==or==

   void *buffer = malloc(w * h * BYTESPERPIXEL);

(you will have to provide values for w and h)

Finally, if you're copying an entire screen, then you can use gl's built
in macros WIDTH and HEIGHT, which always refer to the current context.

=====================

Did I make any mistakes here, anyone?  :-)  :-)  :-)



-J


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:23 IST