diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-11-02 21:31:54 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-11-02 21:31:54 +0300 |
commit | 7d63f5a7fe7378f9bea9e39282828f74bba47287 (patch) | |
tree | 2266b83cb38b26f3e0274d9bca35fa0c75b16e9b /source/gameengine | |
parent | db24487449b1340eed2f29394fdbcdf2e7acc3ea (diff) |
VideoTexture: fix compile error with GLint in ImageViewport under osx.
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/VideoTexture/ImageViewport.cpp | 11 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/ImageViewport.h | 12 |
2 files changed, 11 insertions, 12 deletions
diff --git a/source/gameengine/VideoTexture/ImageViewport.cpp b/source/gameengine/VideoTexture/ImageViewport.cpp index e2b4e469e80..59995198ba1 100644 --- a/source/gameengine/VideoTexture/ImageViewport.cpp +++ b/source/gameengine/VideoTexture/ImageViewport.cpp @@ -25,13 +25,12 @@ http://www.gnu.org/copyleft/lesser.txt. #include <PyObjectPlus.h> #include <structmember.h> -#include "ImageViewport.h" - #include <BIF_gl.h> #include "Texture.h" #include "ImageBase.h" #include "FilterSource.h" +#include "ImageViewport.h" // constructor @@ -81,7 +80,7 @@ void ImageViewport::setCaptureSize (short * size) if (size[idx] < 1) m_capSize[idx] = 1; else if (size[idx] > getViewportSize()[idx]) - m_capSize[idx] = getViewportSize()[idx]; + m_capSize[idx] = short(getViewportSize()[idx]); else m_capSize[idx] = size[idx]; } @@ -91,7 +90,7 @@ void ImageViewport::setCaptureSize (short * size) } // set position of capture rectangle -void ImageViewport::setPosition (int * pos) +void ImageViewport::setPosition (GLint * pos) { // if new position is not provided, use existing position if (pos == NULL) pos = m_position; @@ -125,7 +124,7 @@ void ImageViewport::calcImage (unsigned int texId) { // just copy current viewport to texture glBindTexture(GL_TEXTURE_2D, texId); - glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_upLeft[0], m_upLeft[1], m_capSize[0], m_capSize[1]); + glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1]); // image is not available m_avail = false; } @@ -133,7 +132,7 @@ void ImageViewport::calcImage (unsigned int texId) else if (!m_avail) { // get frame buffer data - glReadPixels(m_upLeft[0], m_upLeft[1], m_capSize[0], m_capSize[1], GL_RGB, + glReadPixels(m_upLeft[0], m_upLeft[1], (GLsizei)m_capSize[0], (GLsizei)m_capSize[1], GL_RGB, GL_UNSIGNED_BYTE, m_viewportImage); // filter loaded data FilterBGR24 filt; diff --git a/source/gameengine/VideoTexture/ImageViewport.h b/source/gameengine/VideoTexture/ImageViewport.h index 9fd3aeb7ba9..4265906b8f5 100644 --- a/source/gameengine/VideoTexture/ImageViewport.h +++ b/source/gameengine/VideoTexture/ImageViewport.h @@ -49,13 +49,13 @@ public: void setCaptureSize (short * size = NULL); /// get position in viewport - int * getPosition (void) { return m_position; } + GLint * getPosition (void) { return m_position; } /// set position in viewport - void setPosition (int * pos = NULL); + void setPosition (GLint * pos = NULL); protected: /// frame buffer rectangle - int m_viewport[4]; + GLint m_viewport[4]; /// size of captured area short m_capSize[2]; @@ -63,9 +63,9 @@ protected: bool m_whole; /// position of capture rectangle in viewport - int m_position[2]; + GLint m_position[2]; /// upper left point for capturing - int m_upLeft[2]; + GLint m_upLeft[2]; /// buffer to copy viewport BYTE * m_viewportImage; @@ -76,7 +76,7 @@ protected: virtual void calcImage (unsigned int texId); /// get viewport size - int * getViewportSize (void) { return m_viewport + 2; } + GLint * getViewportSize (void) { return m_viewport + 2; } }; |