* 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
3.0
sha..rd 14 years ago
parent 5ffa3927ea
commit 8019ba2a53
  1. 3
      engine/src/lwjgl-oal/com/jme3/audio/lwjgl/LwjglAudioRenderer.java
  2. 13
      engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.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);

@ -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);

Loading…
Cancel
Save