Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Bolsee <benoit.bolsee@online.be>2012-02-04 21:20:38 +0400
committerBenoit Bolsee <benoit.bolsee@online.be>2012-02-04 21:20:38 +0400
commit4c7e769aa1e617b1748500d73904921e7a66791d (patch)
tree8324da5cc271959dd6f20ffaa13e711b391c808f /source/gameengine
parentfc0ce537bab8731cc60fda282a6c97d4816011e5 (diff)
BGE bug #29133: Render to Texture not working. Fixed by using same viewport to render and capture.
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/VideoTexture/ImageViewport.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp
index 036dd893dcb..a9354564d0e 100644
--- a/source/gameengine/VideoTexture/ImageViewport.cpp
+++ b/source/gameengine/VideoTexture/ImageViewport.cpp
@@ -31,6 +31,7 @@ http://www.gnu.org/copyleft/lesser.txt.
#include "GL/glew.h"
+#include "KX_PythonInit.h"
#include "Texture.h"
#include "ImageBase.h"
#include "FilterSource.h"
@@ -41,7 +42,13 @@ http://www.gnu.org/copyleft/lesser.txt.
ImageViewport::ImageViewport (void) : m_alpha(false), m_texInit(false)
{
// get viewport rectangle
- glGetIntegerv(GL_VIEWPORT, m_viewport);
+ RAS_Rect rect = KX_GetActiveEngine()->GetCanvas()->GetWindowArea();
+ m_viewport[0] = rect.GetLeft();
+ m_viewport[1] = rect.GetBottom();
+ m_viewport[2] = rect.GetWidth();
+ m_viewport[3] = rect.GetHeight();
+
+ //glGetIntegerv(GL_VIEWPORT, m_viewport);
// create buffer for viewport image
m_viewportImage = new BYTE [4 * getViewportSize()[0] * getViewportSize()[1]];
// set attributes