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; bool _isStencilTwoSidedSupported;
void* _glActiveStencilFace; typedef void (APIENTRY * ActiveStencilFaceProc) (GLenum);
ActiveStencilFaceProc _glActiveStencilFace;
}; };
/** Function to call to get the extension of a specified context. /** 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; } void setMaxTexture3DSize(GLint maxsize) { _maxTexture3DSize=maxsize; }
GLint maxTexture3DSize() const { return _maxTexture3DSize; } 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 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 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; 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; } 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; 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; } 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 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; void gluBuild3DMipmaps( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data) const;
protected: protected:
@ -188,12 +180,19 @@ class OSG_EXPORT Texture3D : public Texture
bool _isTexture3DFast; bool _isTexture3DFast;
GLint _maxTexture3DSize; GLint _maxTexture3DSize;
void* _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);
void* _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);
void* _glCompressedTexImage3D; typedef void (APIENTRY * CompressedTexImage3DArbProc) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
void* _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);
void* _glCopyTexSubImage3D; typedef void (APIENTRY * GLCopyTexSubImageProc) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height );
void* _gluBuild3DMipmaps; 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"); _isStencilTwoSidedSupported = isGLExtensionSupported(contextID,"GL_EXT_stencil_two_side");
_glActiveStencilFace = osg::getGLExtensionFuncPtr("glActiveStencilFace","glActiveStencilFaceEXT"); setGLExtensionFuncPtr(_glActiveStencilFace, "glActiveStencilFace","glActiveStencilFaceEXT");
} }
void StencilTwoSided::Extensions::glActiveStencilFace(GLenum face) const void StencilTwoSided::Extensions::glActiveStencilFace(GLenum face) const
{ {
if (_glActiveStencilFace) if (_glActiveStencilFace)
{ {
typedef void (APIENTRY * ActiveStencilFaceProc) (GLenum); _glActiveStencilFace(face);
((ActiveStencilFaceProc)_glActiveStencilFace)(face);
} }
else else
{ {

View File

@ -1634,8 +1634,6 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID)
return; return;
} }
float glVersion = asciiToFloat( (const char *)version );
const char* renderer = (const char*) glGetString(GL_RENDERER); const char* renderer = (const char*) glGetString(GL_RENDERER);
std::string rendererString(renderer ? 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()); glPixelStorei(GL_UNPACK_ALIGNMENT,image->getPacking());
static MyCompressedTexImage1DArbProc glCompressedTexImage1D_ptr = static MyCompressedTexImage1DArbProc glCompressedTexImage1D_ptr =
(MyCompressedTexImage1DArbProc)getGLExtensionFuncPtr("glCompressedTexImage1DARB"); convertPointerType<MyCompressedTexImage1DArbProc, void*>(getGLExtensionFuncPtr("glCompressedTexImage1DARB"));
if( _min_filter == LINEAR || _min_filter == NEAREST ) 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); glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &_maxTexture3DSize);
_glTexImage3D = getGLExtensionFuncPtr("glTexImage3D","glTexImage3DEXT"); setGLExtensionFuncPtr(_glTexImage3D,"glTexImage3D","glTexImage3DEXT");
_glTexSubImage3D = getGLExtensionFuncPtr("glTexSubImage3D","glTexSubImage3DEXT"); setGLExtensionFuncPtr(_glTexSubImage3D,"glTexSubImage3D","glTexSubImage3DEXT");
_glCompressedTexImage3D = getGLExtensionFuncPtr("glCompressedTexImage3D","glCompressedTexImage3DARB"); setGLExtensionFuncPtr(_glCompressedTexImage3D,"glCompressedTexImage3D","glCompressedTexImage3DARB");
_glCompressedTexSubImage3D = getGLExtensionFuncPtr("glCompressedTexSubImage3D","glCompressedTexSubImage3DARB"); setGLExtensionFuncPtr(_glCompressedTexSubImage3D,"glCompressedTexSubImage3D","glCompressedTexSubImage3DARB");
_glCopyTexSubImage3D = getGLExtensionFuncPtr("glCopyTexSubImage3D","glCopyTexSubImage3DEXT"); setGLExtensionFuncPtr(_glCopyTexSubImage3D,"glCopyTexSubImage3D","glCopyTexSubImage3DEXT");
_gluBuild3DMipmaps = getGLExtensionFuncPtr("gluBuild3DMipmaps"); 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); // ::glTexImage3D( target, level, internalFormat, width, height, depth, border, format, type, pixels);
if (_glTexImage3D) 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); _glTexImage3D( target, level, internalFormat, width, height, depth, border, format, type, pixels);
((GLTexImage3DProc)_glTexImage3D)( target, level, internalFormat, width, height, depth, border, format, type, pixels);
} }
else 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); // ::glTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
if (_glTexSubImage3D) 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); _glTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
((GLTexSubImage3DProc)_glTexSubImage3D)( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
} }
else else
{ {
@ -623,8 +621,7 @@ void Texture3D::Extensions::glCompressedTexImage3D(GLenum target, GLint level, G
{ {
if (_glCompressedTexImage3D) 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); _glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
((CompressedTexImage3DArbProc)_glCompressedTexImage3D)(target, level, internalformat, width, height, depth, border, imageSize, data);
} }
else else
{ {
@ -636,8 +633,7 @@ void Texture3D::Extensions::glCompressedTexSubImage3D( GLenum target, GLint leve
{ {
if (_glCompressedTexSubImage3D) 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); _glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
((CompressedTexSubImage3DArbProc)_glCompressedTexSubImage3D)(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
} }
else else
{ {
@ -650,8 +646,7 @@ void Texture3D::Extensions::glCopyTexSubImage3D( GLenum target, GLint level, GLi
// ::glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); // ::glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
if (_glCopyTexSubImage3D) if (_glCopyTexSubImage3D)
{ {
typedef void (APIENTRY * GLCopyTexSubImageProc) ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ); _glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
((GLCopyTexSubImageProc)_glCopyTexSubImage3D)(target, level, xoffset, yoffset, zoffset, x, y, width, height);
} }
else else
{ {
@ -664,8 +659,7 @@ void Texture3D::Extensions::gluBuild3DMipmaps( GLenum target, GLint internalForm
// ::gluBuild3DMipmaps(target, internalFormat, width, height, depth, format, type, data); // ::gluBuild3DMipmaps(target, internalFormat, width, height, depth, format, type, data);
if (_gluBuild3DMipmaps) if (_gluBuild3DMipmaps)
{ {
typedef void (APIENTRY * GLUBuild3DMipMapsProc) ( GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *data); _gluBuild3DMipmaps(target, internalFormat, width, height, depth, format, type, data);
((GLUBuild3DMipMapsProc)_gluBuild3DMipmaps)(target, internalFormat, width, height, depth, format, type, data);
} }
else else
{ {

View File

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