Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: 2d overlay problem

  1. #1
    Intern Contributor
    Join Date
    Apr 2000
    Location
    Salt Lake City, UT
    Posts
    55

    2d overlay problem

    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.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Posts
    531

    Re: 2d overlay problem

    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)
    ftp://ftp.gdmag.com/pub/src/oct00.zip

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


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

  3. #3
    Intern Contributor
    Join Date
    Apr 2000
    Location
    Salt Lake City, UT
    Posts
    55

    Re: 2d overlay problem

    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).]

  4. #4
    Senior Member OpenGL Guru zed's Avatar
    Join Date
    Jul 2000
    Location
    S41.16.25 E173.16.21
    Posts
    2,609

    Re: 2d overlay problem

    yes keep a copy of your texture data somewhere + replace the old texture with the new (changed one) with glTexSubImage2d(..)

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Posts
    531

    Re: 2d overlay problem

    Originally posted by richardve:
    (little 3D painting prog)
    Oops, excuse me.. I did not read the topic titel very well...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •