VideoTexture: fix compile error with GLint in ImageViewport under osx.

This commit is contained in:
2008-11-02 18:31:54 +00:00
parent db24487449
commit 7d63f5a7fe
2 changed files with 11 additions and 12 deletions

View File

@@ -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;

View File

@@ -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; }
};