Skip to content

Commit 153731c

Browse files
committed
[api] Add RenderPass.setScissor()
1 parent 83f8523 commit 153731c

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

juno-api/src/main/java/org/meteordev/juno/api/commands/RenderPass.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public interface RenderPass {
1818

1919
/**
2020
* Binds a pipeline for subsequent commands.
21-
* This command clears all currently bound images and set uniform data.
21+
* This command clears all currently bound images, set uniform data and scissor window.
2222
* @param pipeline the pipeline to bind.
2323
*/
2424
void bindPipeline(GraphicsPipeline pipeline);
@@ -38,6 +38,16 @@ public interface RenderPass {
3838
*/
3939
void setUniforms(ByteBuffer data, int slot);
4040

41+
/**
42+
* Sets the current scissor region to the specified coordinates. All pixels outside this region won't be rendered.
43+
* To disable scissor you have to set it to the same size as the image you are rendering into.
44+
* @param x the x coordinate starting in the lower-left corner.
45+
* @param y the y coordinate starting in the lower-left corner.
46+
* @param width the width of the region.
47+
* @param height the height of the region.
48+
*/
49+
void setScissor(int x, int y, int width, int height);
50+
4151
/**
4252
* Submits a draw call. Needs a pipeline to be bound and any resources it needs (images and uniforms).
4353
* @param indexBuffer the index buffer to use.

0 commit comments

Comments
 (0)