OpenGL Error handling - Printable Version +- Forums (http://www.scratchpadgames.net/forums) +-- Forum: Main Forums (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=1) +--- Forum: Assets, Tools, Libraries and other useful things (http://www.scratchpadgames.net/forums/forumdisplay.php?fid=21) +--- Thread: OpenGL Error handling (/showthread.php?tid=589) |
OpenGL Error handling - Brian Beuken - 12-07-2022 Pretty sure I have this elsewhere on this forum but adding it again for students to see. OpenGLES2.0 has limited error handling GLint err = glGetError(); Only gives you an indication that an error happend once, sometime ago... you need to step back and find it Its far easier to check an error when it happens, and OpenGLES3.0 allows that. You need to install some libs, your system may not need all of them but best to try and install them. sudo apt-get install libglx-mesa0-dbgsym libglapi-mesa-dbgsym libgl1-mesa-dri-dbgsym Also as this is also an extension it will also need libdl added so add dl to your binary libs it shouldn't need to be installed it should be onboard Next you need a small callback function somewhere in your code but you need to set that up I use this, which is the actual callback and the init function, this lives in my main.cpp file and is called after openGL is initialised. My sincere thanks tomy collegue Phil de Groot for working this out, its proved very helpful. Code: #include <csignal> //Raise and SIGTRAP constants. |