* Throw UnsupportedOperationException if multiple FBO color attachments are used on Android (only a single attachment, GL_COLOR_ATTACHMENT0, is supported)

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10526 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
sha..RD 2013-04-08 01:06:19 +00:00
parent 27bf244729
commit cb0a2ed1cd

View File

@ -1260,11 +1260,11 @@ public class OGLESShaderRenderer implements Renderer {
// can also add support for stencil here // can also add support for stencil here
if (attachmentSlot == -100) { if (attachmentSlot == -100) {
return GLES20.GL_DEPTH_ATTACHMENT; return GLES20.GL_DEPTH_ATTACHMENT;
} else if (attachmentSlot < 0 || attachmentSlot >= 16) { } else if (attachmentSlot == 0) {
throw new UnsupportedOperationException("Invalid FBO attachment slot: " + attachmentSlot); return GLES20.GL_COLOR_ATTACHMENT0;
} else {
throw new UnsupportedOperationException("Android does not support multiple color attachments to an FBO");
} }
return GLES20.GL_COLOR_ATTACHMENT0 + attachmentSlot;
} }
public void updateRenderTexture(FrameBuffer fb, RenderBuffer rb) { public void updateRenderTexture(FrameBuffer fb, RenderBuffer rb) {