* 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; boolean active = true;
int processed = alGetSourcei(sourceId, AL_BUFFERS_PROCESSED); int processed = alGetSourcei(sourceId, AL_BUFFERS_PROCESSED);
while((processed--) != 0){ // while((processed--) != 0){
if (processed > 0){
int buffer; int buffer;
ib.position(0).limit(1); ib.position(0).limit(1);

@ -993,12 +993,13 @@ public class LwjglRenderer implements Renderer {
public void setShader(Shader shader) { public void setShader(Shader shader) {
if (shader == null) { if (shader == null) {
if (context.boundShaderProgram > 0) { throw new IllegalArgumentException("shader cannot be null");
glUseProgram(0); // if (context.boundShaderProgram > 0) {
statistics.onShaderUse(null, true); // glUseProgram(0);
context.boundShaderProgram = 0; // statistics.onShaderUse(null, true);
boundShader = null; // context.boundShaderProgram = 0;
} // boundShader = null;
// }
} else { } else {
if (shader.isUpdateNeeded()) { if (shader.isUpdateNeeded()) {
updateShaderData(shader); updateShaderData(shader);

Loading…
Cancel
Save