View Full Version : 2d overlay problem

08-07-2001, 09:17 AM
I have a textured quad in my scene that covers the window. I want to be able to "draw" on this quad with the mouse. However, whenever I try to, nothing changes. What to do? All I'm doing is I have an array of unsigned bytes to represent the texture, and I'm making changes to the array on mouse down.

08-07-2001, 10:49 AM
What you're trying to do is not as easy as manipulating bytes according to a moving mouse..

I think the following code will be very helpfull: (little 3D painting prog)

(from: http://www.gdmag.com/code.htm )

[This message has been edited by richardve (edited 08-07-2001).]

08-07-2001, 11:06 AM
Ah. Similar to Artisan in Maya... but not exactly what I'm looking to do. I have a textured, 2d quad setup in ortho to cover the window. So basically, I want a 2d paint program implemented in OpenGL. Can I not just change the bitmap and have it update on the next redraw?

[This message has been edited by gtada (edited 08-07-2001).]

08-07-2001, 02:09 PM
yes keep a copy of your texture data somewhere + replace the old texture with the new (changed one) with glTexSubImage2d(..)

08-07-2001, 10:18 PM
Originally posted by richardve:
(little 3D painting prog)

Oops, excuse me.. I did not read the topic titel very well... http://www.opengl.org/discussion_boards/ubb/wink.gif