Added GLExtensions::isPointSpriteModeSupported to allow it to be enable for GL versions that support GL_POINT_SPRITE_ARB/GL_POINT_SPRITE_OES
This commit is contained in:
@@ -627,6 +627,7 @@ class OSG_EXPORT GLExtensions : public osg::Referenced
|
||||
// Point
|
||||
bool isPointParametersSupported;
|
||||
bool isPointSpriteSupported;
|
||||
bool isPointSpriteModeSupported;
|
||||
bool isPointSpriteCoordOriginSupported;
|
||||
|
||||
void (GL_APIENTRY * glPointParameteri) (GLenum pname, GLint param);
|
||||
|
||||
@@ -1054,6 +1054,9 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
|
||||
|
||||
|
||||
isPointSpriteSupported = validContext && (OSG_GLES2_FEATURES || OSG_GLES3_FEATURES || OSG_GL3_FEATURES || isGLExtensionSupported(contextID, "GL_ARB_point_sprite") || isGLExtensionSupported(contextID, "GL_OES_point_sprite") || isGLExtensionSupported(contextID, "GL_NV_point_sprite"));
|
||||
|
||||
isPointSpriteModeSupported = isPointSpriteModeSupported && !OSG_GL3_FEATURES;
|
||||
|
||||
isPointSpriteCoordOriginSupported = validContext && (OSG_GL3_FEATURES || (glVersion >= 2.0f));
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ int PointSprite::compare(const StateAttribute& sa) const
|
||||
bool PointSprite::checkValidityOfAssociatedModes(osg::State& state) const
|
||||
{
|
||||
const GLExtensions* extensions = state.get<GLExtensions>();
|
||||
bool modeValid = extensions->isPointSpriteSupported;
|
||||
bool modeValid = extensions->isPointSpriteModeSupported;
|
||||
|
||||
#if defined( OSG_GLES1_AVAILABLE ) //point sprites don't exist on es 2.0
|
||||
state.setModeValidity(GL_POINT_SPRITE_OES, modeValid);
|
||||
|
||||
Reference in New Issue
Block a user