[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36698] trunk/blender/source/gameengine/ BlenderRoutines/BL_KetsjiEmbedStart.cpp: BGE:

Mitchell Stokes mogurijin at gmail.com
Sun May 15 10:48:44 CEST 2011


Revision: 36698
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36698
Author:   moguri
Date:     2011-05-15 08:48:43 +0000 (Sun, 15 May 2011)
Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp

Modified: trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===================================================================
--- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp	2011-05-15 06:29:52 UTC (rev 36697)
+++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp	2011-05-15 08:48:43 UTC (rev 36698)
@@ -427,6 +427,13 @@
 				{
 					// 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();




More information about the Bf-blender-cvs mailing list