From 33cb2e6f707c2e2d6a98b6c6c37de9f99790a76c Mon Sep 17 00:00:00 2001 From: Daniel Emminizer Date: Wed, 27 Jun 2018 12:57:20 -0400 Subject: [PATCH] OpenFlight: Textures now correctly export in GLCORE mode. --- src/osgPlugins/OpenFlight/expGeometryRecords.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp index 3edeeb72f..4a65cc0ed 100644 --- a/src/osgPlugins/OpenFlight/expGeometryRecords.cpp +++ b/src/osgPlugins/OpenFlight/expGeometryRecords.cpp @@ -63,7 +63,12 @@ bool FltExportVisitor::isTextured( int unit, const osg::Geometry& geom ) const { const osg::StateSet* ss = getCurrentStateSet(); +#ifdef OSG_GL_FIXED_FUNCTION_AVAILABLE bool texOn( ss->getTextureMode( unit, GL_TEXTURE_2D ) & osg::StateAttribute::ON ); +#else + // In this mode, osg::Texture::getModeUsage() is undefined, so just detect if a texture is present + bool texOn = (ss->getTextureAttribute(0, osg::StateAttribute::TEXTURE) != NULL); +#endif bool hasCoords( geom.getTexCoordArray( unit ) != NULL ); return( texOn && hasCoords );