Adapted GLBeginEndAdapter to use state.drawQuad(..) rather than use it's local GL_QUADS emulation.

Fixed to osg::Texture for GLES support.

Added automatic GLenum mode mappings in osg::PrimitiveSet to provide a fallback for non support glDrawArray/glDrawElement modes.

Added finer gained error checking during StateSet::compile().
This commit is contained in:
Robert Osfield
2009-11-12 14:35:44 +00:00
parent efb9908644
commit 8b141567b9
5 changed files with 94 additions and 48 deletions

View File

@@ -1135,7 +1135,7 @@ Texture::Texture():
_useHardwareMipMapGeneration(true),
_unrefImageDataAfterApply(false),
_clientStorageHint(false),
_resizeNonPowerOfTwoHint(true),
_resizeNonPowerOfTwoHint(!OSG_GLES2_FEATURES && !OSG_GL3_FEATURES),
_borderColor(0.0, 0.0, 0.0, 0.0),
_borderWidth(0),
_internalFormatMode(USE_IMAGE_DATA_FORMAT),
@@ -1569,8 +1569,8 @@ void Texture::applyTexParameters(GLenum target, State& state) const
#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
if (ws == CLAMP) ws = CLAMP_TO_EDGE;
if (wt == CLAMP) wr = CLAMP_TO_EDGE;
if (wr == CLAMP) wt = CLAMP_TO_EDGE;
if (wt == CLAMP) wt = CLAMP_TO_EDGE;
if (wr == CLAMP) wr = CLAMP_TO_EDGE;
#endif
const Image * image = getImage(0);
@@ -2455,12 +2455,14 @@ void Texture::Extensions::setupGLExtensions(unsigned int contextID)
_isTextureIntegerEXTSupported = OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_EXT_texture_integer");
#if 0
if (rendererString.find("Radeon")!=std::string::npos || rendererString.find("RADEON")!=std::string::npos)
{
_isNonPowerOfTwoTextureMipMappedSupported = false;
osg::notify(osg::INFO)<<"Disabling _isNonPowerOfTwoTextureMipMappedSupported for ATI hardware."<<std::endl;
}
#endif
if (rendererString.find("GeForce FX")!=std::string::npos)
{
_isNonPowerOfTwoTextureMipMappedSupported = false;