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 2 of 2

Thread: opengl 2d shapes and textures

  1. #1
    Junior Member Regular Contributor
    Join Date
    Apr 2010
    Posts
    110

    opengl 2d shapes and textures

    hello.
    I'm creating a 2d interface in opengl with lines , rectangle and some other 2d shapes in qt.
    I must have a background texture and the shapes on it.
    I use vbo , shader ecc...
    How i can positioning the lines and the shapes for appear on the background texture?
    and what i can use for display the background texture?
    i can create a textured plane for example with z = 0 and the shapes with z = 0.01 ecc...?
    Is a correct approach?

    thanks.

  2. #2
    Member Regular Contributor Rosario Leonardi's Avatar
    Join Date
    Aug 2008
    Location
    Italy
    Posts
    352

    Re: opengl 2d shapes and textures

    To draw the GUI a better approach is to disable the z test and Z write and write the various layer in order.
    So first draw a quad with background then shapes and line over the background.
    ~ ~ I tell you, realtime 3D is made of blood, sweat and screams! ~ ~

Posting Permissions

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