mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-03-06 14:27:44 +00:00
Added a scissor box to clip viewable area. Prevents garbage in the "overscan" areas due to renderer creating viewports that exceed intended display area.
This commit is contained in:
parent
fdedc60f84
commit
c10e839dc0
|
@ -1,9 +1,6 @@
|
||||||
//TODO before release:
|
//TODO before release:
|
||||||
// - remove UI dump input state
|
// - Re-do cursors, make them larger
|
||||||
// - VBL timing?
|
|
||||||
// - Controls for Dirt Devils, and other recent games (is bass working?)
|
|
||||||
// - Comment source code, clean up
|
// - Comment source code, clean up
|
||||||
// - BOOL -> bool, TRUE/FALSE -> true/false
|
|
||||||
// - Add option for building with /MD in MSVC Makefile
|
// - Add option for building with /MD in MSVC Makefile
|
||||||
// - Remove SUPERMODEL_SOUND
|
// - Remove SUPERMODEL_SOUND
|
||||||
|
|
||||||
|
@ -165,7 +162,8 @@ static bool CreateGLScreen(const char *caption, unsigned *xOffsetPtr, unsigned *
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
VideoInfo = SDL_GetVideoInfo(); // what resolution did we actually get?
|
// What resolution did we actually get?
|
||||||
|
VideoInfo = SDL_GetVideoInfo();
|
||||||
|
|
||||||
// If required, fix the aspect ratio of the resolution that the user passed to match Model 3 ratio
|
// If required, fix the aspect ratio of the resolution that the user passed to match Model 3 ratio
|
||||||
xRes = (float) *xResPtr;
|
xRes = (float) *xResPtr;
|
||||||
|
@ -220,6 +218,13 @@ static bool CreateGLScreen(const char *caption, unsigned *xOffsetPtr, unsigned *
|
||||||
*xResPtr = (unsigned) xRes;
|
*xResPtr = (unsigned) xRes;
|
||||||
*yResPtr = (unsigned) yRes;
|
*yResPtr = (unsigned) yRes;
|
||||||
|
|
||||||
|
// Scissor box (to clip visible area)
|
||||||
|
if (VideoInfo->current_w > *xResPtr || VideoInfo->current_h > *yResPtr)
|
||||||
|
{
|
||||||
|
glEnable(GL_SCISSOR_TEST);
|
||||||
|
glScissor(xOffset, yOffset, xRes, yRes);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue