mirror of
https://github.com/minetest/irrlicht.git
synced 2025-06-28 06:20:21 +02:00
Add debug handler
This commit is contained in:
@ -31,6 +31,16 @@ namespace irr
|
||||
namespace video
|
||||
{
|
||||
|
||||
void APIENTRY COpenGL3Driver::debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam)
|
||||
{
|
||||
((COpenGL3Driver *)userParam)->debugCb(source, type, id, severity, length, message);
|
||||
}
|
||||
|
||||
void COpenGL3Driver::debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message)
|
||||
{
|
||||
printf("%04x %04x %x %x %.*s\n", source, type, id, severity, length, message);
|
||||
}
|
||||
|
||||
COpenGL3Driver::COpenGL3Driver(const SIrrlichtCreationParameters& params, io::IFileSystem* io, IContextManager* contextManager) :
|
||||
CNullDriver(io, params.WindowSize), COpenGL3ExtensionHandler(), CacheHandler(0),
|
||||
Params(params), ResetRenderStates(true), LockRenderStateMode(false), AntiAlias(params.AntiAlias),
|
||||
@ -52,6 +62,7 @@ COpenGL3Driver::COpenGL3Driver(const SIrrlichtCreationParameters& params, io::IF
|
||||
ExposedData = ContextManager->getContext();
|
||||
ContextManager->activateContext(ExposedData, false);
|
||||
GL.LoadAllProcedures(ContextManager);
|
||||
GL.DebugMessageCallback(debugCb, this);
|
||||
}
|
||||
|
||||
COpenGL3Driver::~COpenGL3Driver()
|
||||
|
@ -397,6 +397,9 @@ private:
|
||||
ECOLOR_FORMAT ColorFormat;
|
||||
|
||||
IContextManager* ContextManager;
|
||||
|
||||
void debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message);
|
||||
static void APIENTRY debugCb(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *userParam);
|
||||
};
|
||||
|
||||
} // end namespace video
|
||||
|
Reference in New Issue
Block a user