Added check for presence of extension.

This commit is contained in:
Robert Osfield
2010-06-02 15:07:27 +00:00
parent 2846f31c50
commit bac4cfe3d5

View File

@@ -561,13 +561,23 @@ void FrameBufferAttachment::attach(State &state, GLenum target, GLenum attachmen
break;
case Pimpl::TEXTURE3D:
if (_ximpl->zoffset == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER)
ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level);
{
if (ext->glFramebufferTexture)
{
ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level);
}
}
else
ext->glFramebufferTexture3D(target, attachment_point, GL_TEXTURE_3D, tobj->id(), _ximpl->level, _ximpl->zoffset);
break;
case Pimpl::TEXTURE2DARRAY:
if (_ximpl->zoffset == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER)
ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level);
if (_ximpl->cubeMapFace == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER)
{
if (ext->glFramebufferTexture)
{
ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level);
}
}
else
ext->glFramebufferTextureLayer(target, attachment_point, tobj->id(), _ximpl->level, _ximpl->zoffset);
break;
@@ -576,7 +586,12 @@ void FrameBufferAttachment::attach(State &state, GLenum target, GLenum attachmen
break;
case Pimpl::TEXTURECUBE:
if (_ximpl->cubeMapFace == Camera::FACE_CONTROLLED_BY_GEOMETRY_SHADER)
ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level);
{
if (ext->glFramebufferTexture)
{
ext->glFramebufferTexture(target, attachment_point, tobj->id(), _ximpl->level);
}
}
else
ext->glFramebufferTexture2D(target, attachment_point, GL_TEXTURE_CUBE_MAP_POSITIVE_X + _ximpl->cubeMapFace, tobj->id(), _ximpl->level);
break;