Framebuffer debug

Started by Evgeny, January 17, 2021, 19:36:01

Previous topic - Next topic

Evgeny

I use lwjgl 3.2.3 and I have some problems with fbo. How can I enable debug mode for fbo ? I found  glCheckFramebufferStatus only.

Evgeny

Does somebody know something else about it ? Developers where are you ? :)

jakethesnake

Try calling this after every opengl call you make in your troubled code. find the opengl call, and go read the documentation to see what's wrong.

private static final String sInvalid = "GLerr: invalid enum";
	private static final String sValue = "GLerr: invalid value";
	private static final String sOp = "GLerr: invalid operation";
	private static final String sOver = "GLerr: stack overflow";
	private static final String sUnder = "GLerr: stack underflow";
	private static final String sMem = "GLerr: out of memory";
	private static final String sFB = "GLerr: invalid FB operation";
	private static final String sUnknown = "GLerr: unknown";
	
	static String getErrors(){

		switch(glGetError()){
		case GL_NO_ERROR: return null;
		case GL_INVALID_ENUM : return sInvalid;
		case GL_INVALID_VALUE : return sValue;
		case GL_INVALID_OPERATION : return sOp;
		case GL_STACK_OVERFLOW : return sOver;
		case GL_STACK_UNDERFLOW : return sUnder;
		case GL_OUT_OF_MEMORY : diagnozeMem(); return sMem;
		case GL_INVALID_FRAMEBUFFER_OPERATION : return sFB;
		default: return sUnknown;
		}
		
	}