devkitPro / citro3d

Homebrew PICA200 GPU wrapper library for Nintendo 3DS
zlib License
244 stars 34 forks source link

`C3D_SetScissor` does not work as intended? #64

Open TheGag96 opened 9 months ago

TheGag96 commented 9 months ago

The arguments to C3D_SetScissor after the first are left, right, top, bottom. Calling the function like this in the gpusprites example in the examples repo:

C3D_SetScissor(GPU_SCISSOR_NORMAL, 0, 0, 400, 240);

...yields:

image

...which is not what I would expect (a no-op in this case). It renders the same way on console. Is there a bug here?

oreo639 commented 9 months ago

It does work as expected for me. The inputs are X1 Y1 for the start position (e.g. [0,0]) and X2 Y2 for the end position (e.g. [240,400] due to the orientation of the screen). So for C3D_SetScissor(GPU_SCISSORMODE mode, u32 left, u32 top, u32 right, u32 bottom) You would want: C3D_SetScissor(GPU_SCISSOR_NORMAL, 0, 0, 240, 400); or C3D_SetScissor(GPU_SCISSOR_NORMAL, 0, 400, 240, 0)

TheGag96 commented 9 months ago

Ah, gotcha... Might be worth a doc comment in the header.