Changed types from unsigned int to int's to address warnings, and changed the extension requirements so the GLES2 builds with FBO's where supported

This commit is contained in:
Robert Osfield
2010-06-01 18:20:38 +00:00
parent 32e8f6adc3
commit 7f7f1f7d0e
2 changed files with 31 additions and 27 deletions

View File

@@ -360,12 +360,12 @@ namespace osg
FrameBufferAttachment(const FrameBufferAttachment& copy);
explicit FrameBufferAttachment(RenderBuffer* target);
explicit FrameBufferAttachment(Texture1D* target, int level = 0);
explicit FrameBufferAttachment(Texture2D* target, int level = 0);
explicit FrameBufferAttachment(Texture2DMultisample* target, int level = 0);
explicit FrameBufferAttachment(Texture3D* target, int zoffset, int level = 0);
explicit FrameBufferAttachment(Texture2DArray* target, int layer, int level = 0);
explicit FrameBufferAttachment(TextureCubeMap* target, int face, int level = 0);
explicit FrameBufferAttachment(Texture1D* target, unsigned int level = 0);
explicit FrameBufferAttachment(Texture2D* target, unsigned int level = 0);
explicit FrameBufferAttachment(Texture2DMultisample* target, unsigned int level = 0);
explicit FrameBufferAttachment(Texture3D* target, unsigned int zoffset, unsigned int level = 0);
explicit FrameBufferAttachment(Texture2DArray* target, unsigned int layer, unsigned int level = 0);
explicit FrameBufferAttachment(TextureCubeMap* target, unsigned int face, unsigned int level = 0);
explicit FrameBufferAttachment(TextureRectangle* target);
explicit FrameBufferAttachment(Camera::Attachment& attachment);
@@ -384,10 +384,10 @@ namespace osg
Texture* getTexture();
const Texture* getTexture() const;
int getCubeMapFace() const;
int getTextureLevel() const;
int getTexture3DZOffset() const;
int getTextureArrayLayer() const;
unsigned int getCubeMapFace() const;
unsigned int getTextureLevel() const;
unsigned int getTexture3DZOffset() const;
unsigned int getTextureArrayLayer() const;
private:
// use the Pimpl idiom to avoid dependency from

View File

@@ -89,14 +89,18 @@ FBOExtensions::FBOExtensions(unsigned int contextID)
glDeleteFramebuffers != 0 &&
glGenFramebuffers != 0 &&
glCheckFramebufferStatus != 0 &&
glFramebufferTexture1D != 0 &&
glFramebufferTexture2D != 0 &&
glFramebufferTexture3D != 0 &&
glFramebufferTexture != 0 &&
glFramebufferRenderbuffer != 0 &&
glGenerateMipmap != 0 &&
glGetRenderbufferParameteriv != 0;
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
_supported = _supported &&
glFramebufferTexture1D != 0 &&
glFramebufferTexture3D != 0 &&
glFramebufferTexture != 0;
#endif
LOAD_FBO_EXT(glBlitFramebuffer);
LOAD_FBO_EXT(glRenderbufferStorageMultisample);
LOAD_FBO_EXT(glRenderbufferStorageMultisampleCoverageNV);
@@ -298,11 +302,11 @@ struct FrameBufferAttachment::Pimpl
TargetType targetType;
ref_ptr<RenderBuffer> renderbufferTarget;
ref_ptr<Texture> textureTarget;
int cubeMapFace;
int level;
int zoffset;
unsigned int cubeMapFace;
unsigned int level;
unsigned int zoffset;
explicit Pimpl(TargetType ttype = RENDERBUFFER, int lev = 0)
explicit Pimpl(TargetType ttype = RENDERBUFFER, unsigned int lev = 0)
: targetType(ttype),
cubeMapFace(0),
level(lev),
@@ -337,39 +341,39 @@ FrameBufferAttachment::FrameBufferAttachment(RenderBuffer* target)
_ximpl->renderbufferTarget = target;
}
FrameBufferAttachment::FrameBufferAttachment(Texture1D* target, int level)
FrameBufferAttachment::FrameBufferAttachment(Texture1D* target, unsigned int level)
{
_ximpl = new Pimpl(Pimpl::TEXTURE1D, level);
_ximpl->textureTarget = target;
}
FrameBufferAttachment::FrameBufferAttachment(Texture2D* target, int level)
FrameBufferAttachment::FrameBufferAttachment(Texture2D* target, unsigned int level)
{
_ximpl = new Pimpl(Pimpl::TEXTURE2D, level);
_ximpl->textureTarget = target;
}
FrameBufferAttachment::FrameBufferAttachment(Texture2DMultisample* target, int level)
FrameBufferAttachment::FrameBufferAttachment(Texture2DMultisample* target, unsigned int level)
{
_ximpl = new Pimpl(Pimpl::TEXTURE2DMULTISAMPLE, level);
_ximpl->textureTarget = target;
}
FrameBufferAttachment::FrameBufferAttachment(Texture3D* target, int zoffset, int level)
FrameBufferAttachment::FrameBufferAttachment(Texture3D* target, unsigned int zoffset, unsigned int level)
{
_ximpl = new Pimpl(Pimpl::TEXTURE3D, level);
_ximpl->textureTarget = target;
_ximpl->zoffset = zoffset;
}
FrameBufferAttachment::FrameBufferAttachment(Texture2DArray* target, int layer, int level)
FrameBufferAttachment::FrameBufferAttachment(Texture2DArray* target, unsigned int layer, unsigned int level)
{
_ximpl = new Pimpl(Pimpl::TEXTURE2DARRAY, level);
_ximpl->textureTarget = target;
_ximpl->zoffset = layer;
}
FrameBufferAttachment::FrameBufferAttachment(TextureCubeMap* target, int face, int level)
FrameBufferAttachment::FrameBufferAttachment(TextureCubeMap* target, unsigned int face, unsigned int level)
{
_ximpl = new Pimpl(Pimpl::TEXTURECUBE, level);
_ximpl->textureTarget = target;
@@ -618,22 +622,22 @@ const Texture* FrameBufferAttachment::getTexture() const
return _ximpl->textureTarget.get();
}
int FrameBufferAttachment::getCubeMapFace() const
unsigned int FrameBufferAttachment::getCubeMapFace() const
{
return _ximpl->cubeMapFace;
}
int FrameBufferAttachment::getTextureLevel() const
unsigned int FrameBufferAttachment::getTextureLevel() const
{
return _ximpl->level;
}
int FrameBufferAttachment::getTexture3DZOffset() const
unsigned int FrameBufferAttachment::getTexture3DZOffset() const
{
return _ximpl->zoffset;
}
int FrameBufferAttachment::getTextureArrayLayer() const
unsigned int FrameBufferAttachment::getTextureArrayLayer() const
{
return _ximpl->zoffset;
}