Changeset 2373


Ignore:
Timestamp:
Feb 5, 2013, 11:02:17 PM (7 years ago)
Author:
sam
Message:

gpu: avoid using glIsEnabled() if we can cache the data.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/video.cpp

    r2372 r2373  
    5353    static ivec2 saved_viewport;
    5454    static DebugRenderMode render_mode;
     55    static bool face_culling;
    5556#if defined USE_D3D9 || defined _XBOX
    5657#   if defined USE_D3D9
     
    6970ivec2 VideoData::saved_viewport(0, 0);
    7071DebugRenderMode VideoData::render_mode = DebugRenderMode::Default;
     72bool VideoData::face_culling;
    7173
    7274#if defined USE_D3D9 || defined _XBOX
     
    264266#if defined USE_D3D9 || defined _XBOX
    265267#else
    266                 if (glIsEnabled(GL_CULL_FACE) == GL_TRUE)
     268                VideoData::face_culling = !VideoData::face_culling;
     269                if (VideoData::face_culling)
     270                    glEnable(GL_CULL_FACE);
     271                else
    267272                    glDisable(GL_CULL_FACE);
    268                 else
    269                     glEnable(GL_CULL_FACE);
    270273#endif
    271274            }
Note: See TracChangeset for help on using the changeset viewer.