rezaali / ofxUI

[DEPRECATED] UI Addon for openFrameworks
http://www.syedrezaali.com/#/ofxui-project-showcase/
518 stars 202 forks source link

GL_INVALID_OPERATION errors from ofxUI #221

Open moonryul opened 10 years ago

moonryul commented 10 years ago

Hi, I have been testing an application which uses ofxUICanvas class several days. I have been tracking GL_INVALID_OPERATION errors in my application code. Finally I found out that these errors come from ofxUICanvas::draw() method. I am using the core profile of opengl by using the following main:

int main() { ofSetCurrentRenderer(ofGLProgrammableRenderer::TYPE);

ofSetLogLevel(OF_LOG_VERBOSE);
ofSetupOpenGL(1024,768, OF_WINDOW);     
ofRunApp( new ofApp());

}

ofxUICanvas::draw() calls glDisable(GL_LIGHTING) which is deprecated in the core profile. This error seems to occur because I use the core profile, whereas the draw() method uses deprecated commands.

This error also occurs in the following part of the draw() method:

vector<ofxUIWidget >::reverse_iterator it = widgets.rbegin(); vector<ofxUIWidget >::reverse_iterator eit = widgets.rend(); for(; it != eit; ++it) { if((_it)->isVisible() && ((_it)->getRect()->rInside(_rect) || (_it)->isModal())) { (*it)->draw(); checkGlErrors();

    }
}

Question 1: My guess that these GL_INVALID_OPERATON errors are caused by using the core profile is correct?

Question 2: Can I ignore these errors, because GL_INVALID_OPERATION errors simply ignore the offending commands, so that the result is the same as when I do not use these commands?

Question 3: Is there a version of ofxUI which nicely incorporates the core profile?

SIncerely yours Moon Jung