Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

how to control opengl buffer content

hello,

the aim of my program is to move a 50x50 pixel (pic_a) immage over a 500x500 pixel (pic_b) image by moving the mouse over the big image.
also, i have to copy a part of pic_b to produce pic_a and change to rgb color into a grayscale for pic_a. In the end the grayscaled pic_a
has to move over pic_b while exactly matching in content. i know it is hard to explain but i just hope that anybody can give me an idea how to
make a copy, save this and put it into the front. i am using c++ and opengl and think i need several buffers and switch them while moving?

thanks in advance,
patrick
[626 byte] By [patrickH80] at [2007-11-11 10:05:03]
# 1 Re: how to control opengl buffer content
to make the grey image average the rgb (r+g+b)/3. From there you can either use that as a greyscale or insert it 3 times into an rgb and it will look like a greyscale. Generally the wasted memory doing this is bad, but for ease of overlaying it onto what you have it may be acceptable.

For the other one I would plop the small image onto a square and move the square instead of trying to merge the images / do texture magic.

If you want to do this sort of stuff, directdraw is far better suited than gl for it, if you are on a windows computer.
jonnin at 2007-11-11 20:59:28 >