diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-05-15 12:48:43 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-05-15 12:48:43 +0400 |
commit | d05b26c6354a0a77f7f128d0726d85b95f3511ff (patch) | |
tree | 4ed98ba92261e403724ce948da2dfb34d2965671 /source/gameengine/BlenderRoutines | |
parent | 67441238813f245623708b99404c220e1032e66c (diff) |
BGE:
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.
Diffstat (limited to 'source/gameengine/BlenderRoutines')
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 571cc9087b3..4789155dced 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -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(); |