ofxControlPanel icon indicating copy to clipboard operation
ofxControlPanel copied to clipboard

glDisable(GL_DEPTH_TEST);

Open kylemcdonald opened this issue 15 years ago • 3 comments
trafficstars

if depth testing is enabled, nothing draws correctly. ofxControlPanel should detect the state, disable, and restore when done drawing.

kylemcdonald avatar Aug 16 '10 04:08 kylemcdonald

or you should disable depth testing before drawing the control panel ;-)

but if its an easy fix - I think it shouldn't be a problem :) do you have a code snippet ?

ofTheo avatar Aug 16 '10 05:08 ofTheo

yeah, i'm currently disabling depth testing before drawing. but it wasn't really obvious to me what the bug is and took a minute to track down... so it would be great if it was checked for my default!

i just wrote a little snippet for you.

void ofxControlPanel::draw(){
    if( hidden ) return;

    GLboolean isDepthTesting;
    glGetBooleanv(GL_DEPTH_TEST, &isDepthTesting);
    if(isDepthTesting == GL_TRUE)
        glDisable(GL_DEPTH_TEST);
...
    if(isDepthTesting == GL_TRUE)
        glEnable(GL_DEPTH_TEST);
}

kylemcdonald avatar Aug 16 '10 06:08 kylemcdonald

ooops! same error here.. glad i've found these comments! @Theo a quick fixie would be great!

  • ) .r

ruxrux avatar Aug 17 '10 19:08 ruxrux