Thread: drawing my ui (openGL)

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    61

    drawing my ui (openGL)

    I'm creating a user interface for one of my programs in openGL, and I want to draw it as efficiently as possible. The ui consists of a few layers :

    - screens : can be thought of as backgrounds in which you can draw anything you want. Are as big as the window.
    - panels : floating panels in which anything can be drawn. Are not as big as the window, and can overlap.
    - buttons : can be placed in panels (not in screens though).

    Any of these layers (except screens) can be transparant, semi-transparent or not transparent.

    I want to draw the Gui as efficient as possible (I don't want to redraw everything each frame). So if only a panel has to be redrawn, I don't want to redraw the whole screen too. If only one button has to be redrawn, I don't want to redraw the whole panel and screen. This is not easy though when the buttons and panels are semi-transparent. So does anyone have an idea how I can solve this problem ? It has to work on all graphics cards that support openGL (if possible).

    Thanks in advance.

  2. #2
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071
    The UI isn't going to slow down your app much. You could use triangle strips (probably unnecessary, since the UI elements would only need quads anyway), and display lists.

    I'm not sure how to get away with just redrawing a panel rather than the whole screen though.
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you make games without drawing in OpenGL?
    By Jake.c in forum Game Programming
    Replies: 9
    Last Post: 02-11-2009, 10:00 AM
  2. Why only 32x32? (OpenGL) [Please help]
    By Queatrix in forum Game Programming
    Replies: 2
    Last Post: 01-23-2006, 02:39 PM
  3. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  4. Pause in OpenGL, but don't stop drawing... ?
    By Arker in forum Game Programming
    Replies: 4
    Last Post: 10-16-2003, 10:34 PM
  5. Problems Drawing OpenGL to the Client Area
    By Niytaan in forum Windows Programming
    Replies: 3
    Last Post: 10-27-2002, 07:15 PM