Skip to content

Commit

Permalink
several small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
codex128 committed Sep 11, 2024
1 parent 986603c commit b9d7b41
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public interface GeometryRenderHandler {
/**
* Default implementation that renders the geometry and returns true.
*/
public static final GeometryRenderHandler DEFAULT = (rm, geom) -> {
GeometryRenderHandler DEFAULT = (rm, geom) -> {
rm.renderGeometry(geom);
return true;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public <T extends PipelineContext> T getOrCreateContext(Class<T> type, Supplier<
T c = getContext(type);
if (c == null) {
c = supplier.get();
contexts.put(type, c);
registerContext(type, c);
}
return c;
}
Expand Down
17 changes: 13 additions & 4 deletions jme3-core/src/main/java/com/jme3/texture/FrameBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,27 @@ public void addColorTarget(FrameBufferTextureTarget colorBuf){
}

/**
* Sets the color target at the index.
* Replaces the color target at the index.
* <p>
* A color target must already exist at the index, otherwise
* an exception will be thrown.
*
* @param i
* @param colorBuf
* @param i index of color target to replace
* @param colorBuf color target to replace with
*/
public void setColorTarget(int i, FrameBufferTextureTarget colorBuf) {
public void replaceColorTarget(int i, FrameBufferTextureTarget colorBuf) {
if (i < 0 || i >= colorBufs.size()) {
throw new IndexOutOfBoundsException("No color target exists to replace at index=" + i);
}
colorBuf.slot = i;
colorBufs.set(i, colorBuf);
}

/**
* Removes the color target at the index.
* <p>
* Color targets above the removed target will have their
* slot indices shifted accordingly.
*
* @param i
*/
Expand Down

0 comments on commit b9d7b41

Please sign in to comment.