#503 fixed
This commit is contained in:
empirephoenix 2016-11-17 08:52:23 +01:00 committed by GitHub
commit 7958ae2f46

View File

@ -510,14 +510,17 @@ public class FrameBuffer extends NativeObject {
} }
/** /**
* @return The first color buffer attached to this FrameBuffer, or null * @return The color buffer with the index set by {@link #setTargetIndex(int), or null
* if no color buffers are attached. * if no color buffers are attached.
* If MRT is disabled, the first color buffer is returned.
*/ */
public RenderBuffer getColorBuffer() { public RenderBuffer getColorBuffer() {
if (colorBufs.isEmpty()) if (colorBufs.isEmpty())
return null; return null;
if (colorBufIndex<0 || colorBufIndex>=colorBufs.size()) {
return colorBufs.get(0); return colorBufs.get(0);
}
return colorBufs.get(colorBufIndex);
} }
/** /**