From 8019ba2a53d88f98c1a6bfeff304537b800dcdd3 Mon Sep 17 00:00:00 2001 From: "sha..rd" Date: Wed, 20 Apr 2011 18:56:18 +0000 Subject: [PATCH] * LwjglRenderer will throw an exception when attempting to set null shader git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7279 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/audio/lwjgl/LwjglAudioRenderer.java | 3 ++- .../com/jme3/renderer/lwjgl/LwjglRenderer.java | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java b/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java index 1a4e1b5e8..8922a149a 100644 --- a/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java +++ b/engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java @@ -623,7 +623,8 @@ public class LwjglAudioRenderer implements AudioRenderer, Runnable { boolean active = true; int processed = alGetSourcei(sourceId, AL_BUFFERS_PROCESSED); - while((processed--) != 0){ +// while((processed--) != 0){ + if (processed > 0){ int buffer; ib.position(0).limit(1); diff --git a/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java b/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java index 8dd2e9587..53509c11b 100644 --- a/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java +++ b/engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java @@ -993,12 +993,13 @@ public class LwjglRenderer implements Renderer { public void setShader(Shader shader) { if (shader == null) { - if (context.boundShaderProgram > 0) { - glUseProgram(0); - statistics.onShaderUse(null, true); - context.boundShaderProgram = 0; - boundShader = null; - } + throw new IllegalArgumentException("shader cannot be null"); +// if (context.boundShaderProgram > 0) { +// glUseProgram(0); +// statistics.onShaderUse(null, true); +// context.boundShaderProgram = 0; +// boundShader = null; +// } } else { if (shader.isUpdateNeeded()) { updateShaderData(shader);