diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/VideoTexture/ImageViewport.cpp | 9 |
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 |