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

Thread: Overlays and 2D graphics using GL

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    3

    Overlays and 2D graphics using GL

    Greetings, I am coding a 3D game, and although the main screen is 3D, I of course wanna do a 2D interface. I also need to be able to draw images (.bmp files) on this interface
    I know how to do this using DirectDraw, but not with GL
    Any help would be appreciated

    Thanx,
    Pascal

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: Overlays and 2D graphics using GL

    To have your 2d interface, you just disable writing to the depth buffer and you use glOrtho. There is a simpler way with gluOrtho2D. You only to set the lower left corner and the width and the height of your projection.

    To draw bitmaps, you'll have to draw a polygon and texture map it using your bitmap.

  3. #3

    Re: Overlays and 2D graphics using GL

    You don't have to draw polygons to draw bitmaps. You can also use glDrawPixels.

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    3

    Re: Overlays and 2D graphics using GL

    Hude, do you have an exemple on how GLDrawPixel works ?
    Or can you explain it to me ?
    I'd really appreciated,

    Thanx
    Pascal

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Feb 2000
    Posts
    569

    Re: Overlays and 2D graphics using GL

    that's right, you can use glDrawPixels, but it is extremely slow on PC. Using polygons is much more efficient and not really more complex.

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2000
    Posts
    3

    Re: Overlays and 2D graphics using GL

    In any case, Gorg could you point me out to an exemple of some sort using your technique (glOrtho...) please ?
    Just to get me started...

    Pascal

  7. #7

    Re: Overlays and 2D graphics using GL

    There was some document with OGLSDK, in which they told how to make glDrawPixels fast. You had to disable almost every OpenGL state in order to do it. Never tested it though...

Posting Permissions

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