This fixes frame colors not showing up right when using letterbox in the embedded player. Frames are drawn by clearing the whole canvas and then changing the viewport to be within the frames. The problem is that the embedded player's canvas is setup to be within the frames. This means that the extra that would normally be cleared and filled with the frame color is instead the gray color of Blender's region since nothing is actually drawn there by the BGE. To solve this, I just handle the frames in BL_KetsjiEmbedStart.
This commit is contained in:
Mitchell Stokes 2011-05-15 08:48:43 +00:00
parent 6744123881
commit d05b26c635

@ -427,6 +427,13 @@ extern "C" void StartKetsjiShell(struct bContext *C, struct ARegion *ar, rcti *c
{
// first check if we want to exit
exitrequested = ketsjiengine->GetExitCode();
// Clear screen to border color
// We do this here since we set the canvas to be within the frames. This means the engine
// itself is unaware of the extra space, so we clear the whole region for it.
glClearColor(scene->gm.framing.col[0], scene->gm.framing.col[1], scene->gm.framing.col[2], 1.0f);
glViewport(ar->winrct.xmin, ar->winrct.ymin, ar->winrct.xmax, ar->winrct.ymax);
glClear(GL_COLOR_BUFFER_BIT);
// kick the engine
bool render = ketsjiengine->NextFrame();