* 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
This commit is contained in:
sha..rd 2011-04-20 18:56:18 +00:00
parent 5ffa3927ea
commit 8019ba2a53
2 changed files with 9 additions and 7 deletions

View File

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

View File

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