Standardized GLenum's on non EXT versions

This commit is contained in:
Robert Osfield 2016-10-25 18:42:03 +01:00
parent c33f33139e
commit 71da950cee
6 changed files with 24 additions and 24 deletions

View File

@ -628,16 +628,16 @@ typedef char GLchar;
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
#endif
#ifndef GL_TEXTURE_2D_ARRAY_EXT
#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
#ifndef GL_TEXTURE_2D_ARRAY
#define GL_TEXTURE_2D_ARRAY 0x8C1A
#define GL_TEXTURE_2D_ARRAY 0x8C1A
#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
#define GL_COMPARE_REF_DEPTH_TO_TEXTURE 0x884E
#define GL_SAMPLER_2D_ARRAY 0x8DC1
#define GL_SAMPLER_2D_ARRAY_SHADO 0x8DC4
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
#endif
#ifndef GL_MAX_3D_TEXTURE_SIZE

View File

@ -27,12 +27,12 @@
#define GL_TEXTURE_GEN_Q 0x0C63
#endif
#ifndef GL_NORMAL_MAP_ARB
#define GL_NORMAL_MAP_ARB 0x8511
#ifndef GL_NORMAL_MAP
#define GL_NORMAL_MAP 0x8511
#endif
#ifndef GL_REFLECTION_MAP_ARB
#define GL_REFLECTION_MAP_ARB 0x8512
#ifndef GL_REFLECTION_MAP
#define GL_REFLECTION_MAP 0x8512
#endif
namespace osg {
@ -101,8 +101,8 @@ class OSG_EXPORT TexGen : public StateAttribute
OBJECT_LINEAR = GL_OBJECT_LINEAR,
EYE_LINEAR = GL_EYE_LINEAR,
SPHERE_MAP = GL_SPHERE_MAP,
NORMAL_MAP = GL_NORMAL_MAP_ARB,
REFLECTION_MAP = GL_REFLECTION_MAP_ARB
NORMAL_MAP = GL_NORMAL_MAP,
REFLECTION_MAP = GL_REFLECTION_MAP
};
inline void setMode( Mode mode ) { _mode = mode; }

View File

@ -40,7 +40,7 @@ class OSG_EXPORT Texture2DArray : public Texture
/** Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs. */
virtual int compare(const StateAttribute& rhs) const;
virtual GLenum getTextureTarget() const { return GL_TEXTURE_2D_ARRAY_EXT; }
virtual GLenum getTextureTarget() const { return GL_TEXTURE_2D_ARRAY; }
/** Texture2DArray is related to non fixed pipeline usage only so isn't appropriate to enable/disable.*/
virtual bool getModeUsage(StateAttribute::ModeUsage&) const { return false; }

View File

@ -928,7 +928,7 @@ GLExtensions::GLExtensions(unsigned int in_contextID):
max2DSize = 0;
if (validContext) glGetIntegerv(GL_MAX_TEXTURE_SIZE, &max2DSize);
maxLayerCount = 0;
if (validContext) glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS_EXT, &maxLayerCount);
if (validContext) glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, &maxLayerCount);
// Bindless textures
setGLExtensionFuncPtr(glGetTextureHandle, "glGetTextureHandle", "glGetTextureHandleARB","glGetTextureHandleNV", validContext);

View File

@ -1076,10 +1076,10 @@ void Image::readImageFromCurrentTexture(unsigned int contextID, bool copyMipMaps
if (extensions->isTexture2DArraySupported)
{
glGetBooleanv(GL_TEXTURE_BINDING_2D_ARRAY_EXT, &binding2DArray);
glGetBooleanv(GL_TEXTURE_BINDING_2D_ARRAY, &binding2DArray);
}
GLenum textureMode = binding1D ? GL_TEXTURE_1D : binding2D ? GL_TEXTURE_2D : bindingRect ? GL_TEXTURE_RECTANGLE : binding3D ? GL_TEXTURE_3D : binding2DArray ? GL_TEXTURE_2D_ARRAY_EXT : 0;
GLenum textureMode = binding1D ? GL_TEXTURE_1D : binding2D ? GL_TEXTURE_2D : bindingRect ? GL_TEXTURE_RECTANGLE : binding3D ? GL_TEXTURE_3D : binding2DArray ? GL_TEXTURE_2D_ARRAY : 0;
if (bindingCubeMap)
{
switch (face)
@ -1150,7 +1150,7 @@ void Image::readImageFromCurrentTexture(unsigned int contextID, bool copyMipMaps
glGetTexLevelParameteriv(textureMode, 0, GL_TEXTURE_COMPRESSED_ARB,&compressed);
}
}
else if (textureMode==GL_TEXTURE_2D_ARRAY_EXT)
else if (textureMode==GL_TEXTURE_2D_ARRAY)
{
if (extensions->isCompressedTexImage3DSupported())
{

View File

@ -150,8 +150,8 @@ class TextureGLModeSet
_textureModeSet.insert(GL_TEXTURE_BUFFER);
_textureModeSet.insert(GL_TEXTURE_CUBE_MAP);
_textureModeSet.insert(GL_TEXTURE_RECTANGLE_NV);
_textureModeSet.insert(GL_TEXTURE_2D_ARRAY_EXT);
_textureModeSet.insert(GL_TEXTURE_RECTANGLE);
_textureModeSet.insert(GL_TEXTURE_2D_ARRAY);
_textureModeSet.insert(GL_TEXTURE_2D_MULTISAMPLE);
_textureModeSet.insert(GL_TEXTURE_GEN_Q);
@ -1517,7 +1517,7 @@ const StateSet::RefAttributePair* StateSet::getTextureAttributePair(unsigned int
bool StateSet::checkValidityOfAssociatedModes(osg::State& state) const
{
OSG_NOTICE<<__PRETTY_FUNCTION__<<std::endl;
//OSG_NOTICE<<__PRETTY_FUNCTION__<<std::endl;
bool modesValid = true;
for(AttributeList::const_iterator itr = _attributeList.begin();