From 455a621384a2c593849ceec0d325e9072952e6e9 Mon Sep 17 00:00:00 2001 From: "sha..RD" Date: Fri, 25 Jan 2013 02:15:50 +0000 Subject: [PATCH] * Fix android native crashes and other bizarre problems with 32-bit index buffers git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10145 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/renderer/android/OGLESShaderRenderer.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java index 50b2a23cd..97587cf30 100644 --- a/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java +++ b/engine/src/android/com/jme3/renderer/android/OGLESShaderRenderer.java @@ -1887,6 +1887,12 @@ public class OGLESShaderRenderer implements Renderer { boolean useInstancing = count > 1 && caps.contains(Caps.MeshInstancing); Buffer indexData = indexBuf.getData(); + + if (indexBuf.getFormat() == Format.UnsignedInt) { + throw new RendererException("OpenGL ES does not support 32-bit index buffers." + + "Split your models to avoid going over 65536 vertices."); + } + if (mesh.getMode() == Mode.Hybrid) { int[] modeStart = mesh.getModeStart(); int[] elementLengths = mesh.getElementLengths();