From ea28e8a4491982d7d0927f00423fdd1bb4fa0bf7 Mon Sep 17 00:00:00 2001 From: Julien Gouesse Date: Sat, 31 Oct 2015 11:00:17 +0100 Subject: [PATCH] First attempt to fix a bug reported by david_bernard_31, the size of the strings in the shader code was wrongly computed for the JOGL backend --- .../src/main/java/com/jme3/renderer/jogl/JoglGL.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglGL.java b/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglGL.java index e1c2a2505..3da2ed49e 100644 --- a/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglGL.java +++ b/jme3-jogl/src/main/java/com/jme3/renderer/jogl/JoglGL.java @@ -532,6 +532,15 @@ public class JoglGL implements GL, GL2, GL3, GL4 { @Override public void glShaderSource(int param1, String[] param2, IntBuffer param3) { checkLimit(param3); + + int param3pos = param3.position(); + try { + for (final String param2string : param2) { + param3.put(Math.max(param2string.length(), param2string.getBytes().length)); + } + } finally { + param3.position(param3pos); + } GLContext.getCurrentGL().getGL2ES2().glShaderSource(param1, param2.length, param2, param3); }