Skip to main content
gamedev.net
🔒 Locked

GUI flicker

Started by sipickles Aug 22, 2006 at 8:41 AM 0 replies 850+ views
Original Post
sipickles
sipickles
Hello! A question about my DXGUI method... To draw my GUI with directX and C++, I am filling a dynamic VB each frame. Each window, or inherited type, is passed the pointer to the locked VB and it adds its childrens then its own vertices, recursively. The whole GUI uses a single texture, containing all the GUI elements. The texture is black and white, and colour is added using D3D vertex declaration structure. This works fine on the whole. Occasionally some elements of the GUI will flicker, like they are not being drawn for a single frame. This is common when an element has changed colour from one frame to the next. The colour change is a result of a SWITCH/CASE statement, so there is no transparent state involved, eg:

switch ( m_state )
{
    case WINSTATE_ACTIVE: m_colour = RED;
                          break;
    default: m_colour = BLACK;
             break;
}


I know its probably a bug in my programming, but I just wondered if anyone had a simliar experience. Thanks for any advice Simon
circlesoft
circlesoft
Quote:
Original post by sipickles
I know its probably a bug in my programming, but I just wondered if anyone had a simliar experience.

In GUIs that I have worked on, I have encountered flickering a few times. Normally it was the result of:

- Setting the wrong alpha
- Messed up timing calculation
- Incorrect layering / z-values

Of course, your problem could be with none of these - but just something to think about.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.