sceGuScissor does not take in:
startX, startY, width, height
but instead takes in:
startX, startY, endX, endY
You can optionally change the 'w' to 'stopX' and 'h' to 'stopY'
in this file:
/trunk/pspsdk/src/gu/sceGuScissor.c
But the more important one to update I guess is:
/trunk/pspsdk/src/gu/pspgu.h
(CTRL+F for sceGuScissor)
This below is the fixed version:
(Also, originally the comment description was:
* Set what to scissor within the current viewport"
This is somewhat misinformative because sceGuScissor is not affected by the sceGuViewport (it's not contained within the viewport), but by sceGuOffset which dictates the 'top-left' position in the framebuffer)
Code: Select all
/**
* Set what to scissor within the current framebuffer
*
* Note that scissoring is only performed if the custom scissoring is enabled (GU_SCISSOR_TEST)
*
* @param x - Left of scissor region
* @param y - Top of scissor region
* @param stopX - Right of scissor region
* @param stopY - Bottom of scissor region
**/
void sceGuScissor(int x, int y, int stopX, int stopY);
Anyways, for people googling on how to simulate glViewport using sceGuViewport:
PC-GL:
Code: Select all
#define sgl_viewport(a_x, a_y, a_width, a_height) glViewport(a_x, a_y, a_width, a_height)
Code: Select all
#define sgl_viewport(a_x, a_y, a_width, a_height) { sceGuViewport(1808+(a_x)+((a_width)/2), 2184-(a_y)-((a_height)/2), a_width, a_height); sceGuScissor(a_x, 272-(a_y)-(a_height), (a_x)+(a_width), 272-(a_y)); }