Fixed warnings

This commit is contained in:
Robert Osfield 2008-12-17 16:13:23 +00:00
parent 4f561d84b3
commit 2225339208
7 changed files with 30 additions and 41 deletions

View File

@ -161,7 +161,8 @@ class OSG_EXPORT StencilTwoSided : public StateAttribute
bool _isStencilTwoSidedSupported;
void* _glActiveStencilFace;
typedef void (APIENTRY * ActiveStencilFaceProc) (GLenum);
ActiveStencilFaceProc _glActiveStencilFace;
};
/** Function to call to get the extension of a specified context.

View File

@ -160,24 +160,16 @@ class OSG_EXPORT Texture3D : public Texture
void setMaxTexture3DSize(GLint maxsize) { _maxTexture3DSize=maxsize; }
GLint maxTexture3DSize() const { return _maxTexture3DSize; }
void setTexImage3DProc(void* ptr) { _glTexImage3D = ptr; }
void glTexImage3D( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) const;
void setTexSubImage3DProc(void* ptr) { _glTexSubImage3D = ptr; }
void glTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels) const;
void setCopyTexSubImage3DProc(void* ptr) { _glCopyTexSubImage3D = ptr; }
void glCopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) const;
bool isCompressedTexImage3DSupported() const { return _glCompressedTexImage3D!=0; }
void setCompressedTexImage3DProc(void* ptr) { _glCompressedTexImage3D = ptr; }
void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data) const;
bool isCompressedTexSubImage3DSupported() const { return _glCompressedTexSubImage3D!=0; }
void setCompressedTexSubImage3DProc(void* ptr) { _glCompressedTexSubImage3D = ptr; }
void glCompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) const;
void setBuild3DMipmapsProc(void* ptr) { _gluBuild3DMipmaps = ptr; }
void gluBuild3DMipmaps( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) const;
protected:
@ -188,12 +180,19 @@ class OSG_EXPORT Texture3D : public Texture
bool _isTexture3DFast;
GLint _maxTexture3DSize;
void* _glTexImage3D;
void* _glTexSubImage3D;
void* _glCompressedTexImage3D;
void* _glCompressedTexSubImage3D;
void* _glCopyTexSubImage3D;
void* _gluBuild3DMipmaps;
typedef void (APIENTRY * GLTexImage3DProc) ( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRY * GLTexSubImage3DProc) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
typedef void (APIENTRY * CompressedTexImage3DArbProc) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRY * CompressedTexSubImage3DArbProc) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
typedef void (APIENTRY * GLCopyTexSubImageProc) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
typedef void (APIENTRY * GLUBuild3DMipMapsProc) ( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data);
GLTexImage3DProc _glTexImage3D;
GLTexSubImage3DProc _glTexSubImage3D;
CompressedTexImage3DArbProc _glCompressedTexImage3D;
CompressedTexSubImage3DArbProc _glCompressedTexSubImage3D;
GLCopyTexSubImageProc _glCopyTexSubImage3D;
GLUBuild3DMipMapsProc _gluBuild3DMipmaps;
};

View File

@ -142,15 +142,14 @@ void StencilTwoSided::Extensions::setupGLExtensions(unsigned int contextID)
{
_isStencilTwoSidedSupported = isGLExtensionSupported(contextID,"GL_EXT_stencil_two_side");
_glActiveStencilFace = osg::getGLExtensionFuncPtr("glActiveStencilFace","glActiveStencilFaceEXT");
setGLExtensionFuncPtr(_glActiveStencilFace, "glActiveStencilFace","glActiveStencilFaceEXT");
}
void StencilTwoSided::Extensions::glActiveStencilFace(GLenum face) const
{
if (_glActiveStencilFace)
{
typedef void (APIENTRY * ActiveStencilFaceProc) (GLenum);
((ActiveStencilFaceProc)_glActiveStencilFace)(face);
_glActiveStencilFace(face);
}
else
{

View File

@ -1634,8 +1634,6 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID)
return;
}
float glVersion = asciiToFloat( (const char *)version );
const char* renderer = (const char*) glGetString(GL_RENDERER);
std::string rendererString(renderer ? renderer : "");

View File

@ -261,7 +261,7 @@ void Texture1D::applyTexImage1D(GLenum target, Image* image, State& state, GLsiz
glPixelStorei(GL_UNPACK_ALIGNMENT,image->getPacking());
static MyCompressedTexImage1DArbProc glCompressedTexImage1D_ptr =
(MyCompressedTexImage1DArbProc)getGLExtensionFuncPtr("glCompressedTexImage1DARB");
convertPointerType<MyCompressedTexImage1DArbProc, void*>(getGLExtensionFuncPtr("glCompressedTexImage1DARB"));
if( _min_filter == LINEAR || _min_filter == NEAREST )
{

View File

@ -582,12 +582,12 @@ void Texture3D::Extensions::setupGLExtensions(unsigned int contextID)
glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &_maxTexture3DSize);
_glTexImage3D = getGLExtensionFuncPtr("glTexImage3D","glTexImage3DEXT");
_glTexSubImage3D = getGLExtensionFuncPtr("glTexSubImage3D","glTexSubImage3DEXT");
_glCompressedTexImage3D = getGLExtensionFuncPtr("glCompressedTexImage3D","glCompressedTexImage3DARB");
_glCompressedTexSubImage3D = getGLExtensionFuncPtr("glCompressedTexSubImage3D","glCompressedTexSubImage3DARB");
_glCopyTexSubImage3D = getGLExtensionFuncPtr("glCopyTexSubImage3D","glCopyTexSubImage3DEXT");
_gluBuild3DMipmaps = getGLExtensionFuncPtr("gluBuild3DMipmaps");
setGLExtensionFuncPtr(_glTexImage3D,"glTexImage3D","glTexImage3DEXT");
setGLExtensionFuncPtr(_glTexSubImage3D,"glTexSubImage3D","glTexSubImage3DEXT");
setGLExtensionFuncPtr(_glCompressedTexImage3D,"glCompressedTexImage3D","glCompressedTexImage3DARB");
setGLExtensionFuncPtr(_glCompressedTexSubImage3D,"glCompressedTexSubImage3D","glCompressedTexSubImage3DARB");
setGLExtensionFuncPtr(_glCopyTexSubImage3D,"glCopyTexSubImage3D","glCopyTexSubImage3DEXT");
setGLExtensionFuncPtr(_gluBuild3DMipmaps,"gluBuild3DMipmaps");
}
@ -596,8 +596,7 @@ void Texture3D::Extensions::glTexImage3D( GLenum target, GLint level, GLenum int
// ::glTexImage3D( target, level, internalFormat, width, height, depth, border, format, type, pixels);
if (_glTexImage3D)
{
typedef void (APIENTRY * GLTexImage3DProc) ( GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
((GLTexImage3DProc)_glTexImage3D)( target, level, internalFormat, width, height, depth, border, format, type, pixels);
_glTexImage3D( target, level, internalFormat, width, height, depth, border, format, type, pixels);
}
else
{
@ -610,8 +609,7 @@ void Texture3D::Extensions::glTexSubImage3D( GLenum target, GLint level, GLint x
// ::glTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
if (_glTexSubImage3D)
{
typedef void (APIENTRY * GLTexSubImage3DProc) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
((GLTexSubImage3DProc)_glTexSubImage3D)( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
_glTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
}
else
{
@ -623,8 +621,7 @@ void Texture3D::Extensions::glCompressedTexImage3D(GLenum target, GLint level, G
{
if (_glCompressedTexImage3D)
{
typedef void (APIENTRY * CompressedTexImage3DArbProc) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
((CompressedTexImage3DArbProc)_glCompressedTexImage3D)(target, level, internalformat, width, height, depth, border, imageSize, data);
_glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
}
else
{
@ -636,8 +633,7 @@ void Texture3D::Extensions::glCompressedTexSubImage3D( GLenum target, GLint leve
{
if (_glCompressedTexSubImage3D)
{
typedef void (APIENTRY * CompressedTexSubImage3DArbProc) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
((CompressedTexSubImage3DArbProc)_glCompressedTexSubImage3D)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
_glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
}
else
{
@ -650,8 +646,7 @@ void Texture3D::Extensions::glCopyTexSubImage3D( GLenum target, GLint level, GLi
// ::glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
if (_glCopyTexSubImage3D)
{
typedef void (APIENTRY * GLCopyTexSubImageProc) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
((GLCopyTexSubImageProc)_glCopyTexSubImage3D)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
_glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
}
else
{
@ -664,8 +659,7 @@ void Texture3D::Extensions::gluBuild3DMipmaps( GLenum target, GLint internalForm
// ::gluBuild3DMipmaps(target, internalFormat, width, height, depth, format, type, data);
if (_gluBuild3DMipmaps)
{
typedef void (APIENTRY * GLUBuild3DMipMapsProc) ( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data);
((GLUBuild3DMipMapsProc)_gluBuild3DMipmaps)(target, internalFormat, width, height, depth, format, type, data);
_gluBuild3DMipmaps(target, internalFormat, width, height, depth, format, type, data);
}
else
{

View File

@ -51,8 +51,6 @@ void HeightFieldLayer::write(DataOutputStream* out)
out->writeFloat(hf->getSkirtHeight());
out->writeUInt(hf->getBorderWidth());
int packingSize = 1;
float maxError = 0.0f;
if (getLocator())