diff options
Diffstat (limited to 'source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp')
-rw-r--r-- | source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp index 346d2017ef0..6ab1d032bf2 100644 --- a/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp +++ b/source/gameengine/BlenderRoutines/KX_BlenderCanvas.cpp @@ -154,11 +154,11 @@ SetViewPort( int x1, int y1, int x2, int y2 ) { - /* x1 and y1 are the min pixel coordinate (e.g. 0) - x2 and y2 are the max pixel coordinate - the width,height is calculated including both pixels - therefore: max - min + 1 - */ + /* x1 and y1 are the min pixel coordinate (e.g. 0) + * x2 and y2 are the max pixel coordinate + * the width,height is calculated including both pixels + * therefore: max - min + 1 + */ int vp_width = (x2 - x1) + 1; int vp_height = (y2 - y1) + 1; int minx = m_frame_rect.GetLeft(); @@ -178,6 +178,18 @@ SetViewPort( glScissor(minx + x1, miny + y1, vp_width, vp_height); } + void +KX_BlenderCanvas:: +UpdateViewPort( + int x1, int y1, + int x2, int y2 +) { + m_viewport[0] = x1; + m_viewport[1] = y1; + m_viewport[2] = x2; + m_viewport[3] = y2; +} + const int* KX_BlenderCanvas:: GetViewPort() { |