Ignore:
Timestamp:
Sep 13, 2010, 1:34:00 AM (10 years ago)
Author:
sam
Message:

Put HUD objects back on front of the scene.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/video.cpp

    r209 r211  
    3636    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    3737    glClearDepth(1.0);
    38 
    39     glEnable(GL_DEPTH_TEST);
    40     glDepthFunc(GL_LEQUAL);
    41     glEnable(GL_ALPHA_TEST);
    42     glAlphaFunc(GL_GEQUAL, 0.01f);
    43     glEnable(GL_BLEND);
    44     glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    4538
    4639    glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
     
    9083}
    9184
     85void Video::SetDepth(bool set)
     86{
     87    if (set)
     88        glEnable(GL_DEPTH_TEST);
     89    else
     90        glDisable(GL_DEPTH_TEST);
     91}
     92
    9293void Video::Clear()
    9394{
     95    glEnable(GL_DEPTH_TEST);
     96    glDepthFunc(GL_LEQUAL);
     97    glEnable(GL_ALPHA_TEST);
     98    glAlphaFunc(GL_GEQUAL, 0.01f);
     99    glEnable(GL_BLEND);
     100    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     101
    94102    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    95103
Note: See TracChangeset for help on using the changeset viewer.