From 4afe6456f631352933bd5dcb7610b516a90f29eb Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 1 Aug 2011 20:15:35 +0200 Subject: Fix glDebugMessageInsert: Pass string length to native method instead of -1/0, avoid driver bug. --- src/jogl/classes/jogamp/opengl/GLContextImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/jogl/classes/jogamp/opengl') diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java index aef90dbe6..6be2705e5 100644 --- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java +++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java @@ -1147,10 +1147,11 @@ public abstract class GLContextImpl extends GLContext { } public final void glDebugMessageInsert(int source, int type, int id, int severity, String buf) { + final int len = (null != buf) ? buf.length() : 0; if(glDebugHandler.isExtensionARB()) { - gl.getGL2GL3().glDebugMessageInsertARB(source, type, id, severity, -1, buf); + gl.getGL2GL3().glDebugMessageInsertARB(source, type, id, severity, len, buf); } else if(glDebugHandler.isExtensionAMD()) { - gl.getGL2GL3().glDebugMessageInsertAMD(GLDebugMessage.translateARB2AMDCategory(source, type), severity, id, 0, buf); + gl.getGL2GL3().glDebugMessageInsertAMD(GLDebugMessage.translateARB2AMDCategory(source, type), severity, id, len, buf); } } } -- cgit v1.2.3