diff -rupN ./opensg_org/Source/System/State/Base/OSGTextureObjChunk.cpp ./opensg_texture/Source/System/State/Base/OSGTextureObjChunk.cpp
--- ./opensg_org/Source/System/State/Base/OSGTextureObjChunk.cpp 2017-01-16 11:34:55.022138400 +0100
+++ ./opensg_texture/Source/System/State/Base/OSGTextureObjChunk.cpp 2016-09-26 12:15:54.703999700 +0200
@@ -480,7 +480,8 @@ void TextureObjChunk::handleTexture(Wind
}
if((imgtarget == GL_TEXTURE_1D_ARRAY ||
- imgtarget == GL_TEXTURE_2D_ARRAY ) &&
+ imgtarget == GL_TEXTURE_2D_ARRAY ||
+ imgtarget == GL_TEXTURE_CUBE_MAP_ARRAY) &&
!win->hasExtOrVersion(_extTextureArray, 0x0300))
{
FWARNING(("texture arrays not supported on Window %p!\n",
@@ -596,18 +597,21 @@ void TextureObjChunk::handleTexture(Wind
glTexParameteri(paramtarget, GL_TEXTURE_MAG_FILTER, getMagFilter());
glTexParameteri(paramtarget, GL_TEXTURE_WRAP_S, getWrapS());
- if(paramtarget == GL_TEXTURE_2D ||
- paramtarget == GL_TEXTURE_2D_ARRAY ||
- paramtarget == GL_TEXTURE_3D ||
- paramtarget == GL_TEXTURE_CUBE_MAP_ARB ||
- paramtarget == GL_TEXTURE_RECTANGLE_ARB )
+ if(paramtarget == GL_TEXTURE_2D ||
+ paramtarget == GL_TEXTURE_2D_ARRAY ||
+ paramtarget == GL_TEXTURE_3D ||
+ paramtarget == GL_TEXTURE_CUBE_MAP_ARB ||
+ paramtarget == GL_TEXTURE_CUBE_MAP_ARRAY ||
+ paramtarget == GL_TEXTURE_RECTANGLE_ARB )
{
glTexParameteri(paramtarget, GL_TEXTURE_WRAP_T, getWrapT());
}
- if(paramtarget == GL_TEXTURE_2D_ARRAY ||
- paramtarget == GL_TEXTURE_3D ||
- paramtarget == GL_TEXTURE_CUBE_MAP_ARB )
+ if(paramtarget == GL_TEXTURE_2D_ARRAY ||
+ paramtarget == GL_TEXTURE_3D ||
+ paramtarget == GL_TEXTURE_CUBE_MAP_ARB ||
+ paramtarget == GL_TEXTURE_CUBE_MAP_ARRAY )
+
{
glTexParameteri(paramtarget, GL_TEXTURE_WRAP_R, getWrapR());
}
@@ -748,6 +752,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlCompressedTexImage3D(
imgtarget,
i - baseLevel,
@@ -802,6 +807,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlTexImage3D(imgtarget,
i - baseLevel,
internalFormat,
@@ -1124,6 +1130,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlCompressedTexImage3D(imgtarget, 0,
internalFormat,
osgNextPower2(width),
@@ -1192,6 +1199,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlTexImage3D(imgtarget,
0,
internalFormat,
@@ -1269,6 +1277,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlCompressedTexImage3D(imgtarget, 0,
internalFormat,
width, height, depth,
@@ -1315,6 +1324,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlTexImage3D(imgtarget, 0, internalFormat,
width, height, depth,
getBorderWidth(),
@@ -1470,6 +1480,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlCompressedTexSubImage3D(imgtarget, 0,
ix, iy, iz,
w, h, d,
@@ -1515,6 +1526,7 @@ void TextureObjChunk::handleTexture(Wind
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
osgGlTexSubImage3D(imgtarget, 0, ix, iy, iz,
w, h, d,
externalFormat, type,
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.cpp ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.cpp
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.cpp 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.cpp 2016-07-25 10:44:24.182218700 +0200
@@ -56,19 +56,10 @@
OSG_BEGIN_NAMESPACE
-typedef void (OSG_APIENTRY *osgGlFramebufferTextureProc) (GLenum target,
- GLenum attachment,
- GLuint texture,
- GLint level );
-
-
-UInt32 LayeredTextureBuffer::_uiGeoShader4_extension =
- Window::invalidExtensionID;
-
UInt32 LayeredTextureBuffer::_uiFramebuffer_object_extension =
Window::invalidExtensionID;
-UInt32 LayeredTextureBuffer::_uiFuncFramebufferTexture =
+UInt32 LayeredTextureBuffer::_uiFuncFramebufferTextureLayer =
Window::invalidFunctionID;
UInt32 LayeredTextureBuffer::_uiFuncGenerateMipmap =
@@ -100,19 +91,21 @@ void LayeredTextureBuffer::bind(DrawEnv
switch(target)
{
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_3D:
{
- OSGGETGLFUNCBYID_GL3( glFramebufferTexture,
- osgGlFramebufferTexture,
- _uiFuncFramebufferTexture,
+ OSGGETGLFUNCBYID_GL3( glFramebufferTextureLayer,
+ osgGlFramebufferTextureLayer,
+ _uiFuncFramebufferTextureLayer,
pWindow);
- osgGlFramebufferTexture(
+ osgGlFramebufferTextureLayer(
GL_FRAMEBUFFER,
index,
pWindow->getGLObjectId(_sfTexture.getValue()->getGLId()),
- 0);
+ getLevel(),
+ getLayer());
}
break;
}
@@ -314,16 +307,13 @@ void LayeredTextureBuffer::initMethod(In
if(ePhase == TypeObject::SystemPost)
{
- _uiGeoShader4_extension =
- Window::registerExtension("GL_ARB_geometry_shader4");
-
_uiFramebuffer_object_extension =
Window::registerExtension("GL_ARB_framebuffer_object");
- _uiFuncFramebufferTexture =
+ _uiFuncFramebufferTextureLayer =
Window::registerFunction (
- OSG_DLSYM_UNDERSCORE"glFramebufferTexture",
- _uiGeoShader4_extension);
+ OSG_DLSYM_UNDERSCORE"glFramebufferTextureLayer",
+ _uiFramebuffer_object_extension);
_uiFuncGenerateMipmap =
Window::registerFunction (
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.fcd ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.fcd
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.fcd 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.fcd 2016-07-25 09:50:41.912916800 +0200
@@ -45,13 +45,13 @@
The mipmap level in the texture to target.
- UNUSED.
+ The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.h ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.h
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.h 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBuffer.h 2016-07-25 10:38:23.975458500 +0200
@@ -138,10 +138,9 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
/*! \name GL */
/*! \{ */
- static UInt32 _uiGeoShader4_extension;
static UInt32 _uiFramebuffer_object_extension;
- static UInt32 _uiFuncFramebufferTexture;
+ static UInt32 _uiFuncFramebufferTextureLayer;
static UInt32 _uiFuncGenerateMipmap;
/*! \} */
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.cpp ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.cpp
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.cpp 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.cpp 2017-01-16 12:06:21.221850200 +0100
@@ -98,8 +98,8 @@ OSG_BEGIN_NAMESPACE
The mipmap level in the texture to target.
*/
-/*! \var UInt32 LayeredTextureBufferBase::_sfZoffset
- UNUSED.
+/*! \var UInt32 LayeredTextureBufferBase::_sfLayer
+ The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.
*/
@@ -173,13 +173,13 @@ void LayeredTextureBufferBase::classDesc
pDesc = new SFUInt32::Description(
SFUInt32::getClassType(),
- "zoffset",
- "UNUSED.\n",
- ZoffsetFieldId, ZoffsetFieldMask,
+ "layer",
+ "The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.\n",
+ LayerFieldId, LayerFieldMask,
false,
(Field::SFDefaultFlags | Field::FStdAccess),
- static_cast(&LayeredTextureBuffer::editHandleZoffset),
- static_cast(&LayeredTextureBuffer::getHandleZoffset));
+ static_cast(&LayeredTextureBuffer::editHandleLayer),
+ static_cast(&LayeredTextureBuffer::getHandleLayer));
oType.addInitialDesc(pDesc);
}
@@ -243,14 +243,14 @@ LayeredTextureBufferBase::TypeObject Lay
" The mipmap level in the texture to target.\n"
" \n"
" \n"
- " UNUSED.\n"
+ " The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.\n"
" \n"
"\n",
"Texture buffer. Wraps support to binding a framebuffer attachment to an OpenSG texture object.\n"
@@ -332,16 +332,16 @@ const SFUInt32 *LayeredTextureBufferBase
}
-SFUInt32 *LayeredTextureBufferBase::editSFZoffset(void)
+SFUInt32 *LayeredTextureBufferBase::editSFLayer(void)
{
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
- return &_sfZoffset;
+ return &_sfLayer;
}
-const SFUInt32 *LayeredTextureBufferBase::getSFZoffset(void) const
+const SFUInt32 *LayeredTextureBufferBase::getSFLayer(void) const
{
- return &_sfZoffset;
+ return &_sfLayer;
}
@@ -367,9 +367,9 @@ SizeT LayeredTextureBufferBase::getBinSi
{
returnValue += _sfLevel.getBinSize();
}
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
{
- returnValue += _sfZoffset.getBinSize();
+ returnValue += _sfLayer.getBinSize();
}
return returnValue;
@@ -392,9 +392,9 @@ void LayeredTextureBufferBase::copyToBin
{
_sfLevel.copyToBin(pMem);
}
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
{
- _sfZoffset.copyToBin(pMem);
+ _sfLayer.copyToBin(pMem);
}
}
@@ -418,10 +418,10 @@ void LayeredTextureBufferBase::copyFromB
editSField(LevelFieldMask);
_sfLevel.copyFromBin(pMem);
}
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
{
- editSField(ZoffsetFieldMask);
- _sfZoffset.copyFromBin(pMem);
+ editSField(LayerFieldMask);
+ _sfLayer.copyFromBin(pMem);
}
}
@@ -551,7 +551,7 @@ LayeredTextureBufferBase::LayeredTexture
_sfTexture (NULL),
_sfTexTarget (GLenum(GL_NONE)),
_sfLevel (UInt32(0)),
- _sfZoffset (UInt32(0))
+ _sfLayer (UInt32(0))
{
}
@@ -560,7 +560,7 @@ LayeredTextureBufferBase::LayeredTexture
_sfTexture (NULL),
_sfTexTarget (source._sfTexTarget ),
_sfLevel (source._sfLevel ),
- _sfZoffset (source._sfZoffset )
+ _sfLayer (source._sfLayer )
{
}
@@ -661,27 +661,27 @@ EditFieldHandlePtr LayeredTextureBufferB
return returnValue;
}
-GetFieldHandlePtr LayeredTextureBufferBase::getHandleZoffset (void) const
+GetFieldHandlePtr LayeredTextureBufferBase::getHandleLayer (void) const
{
SFUInt32::GetHandlePtr returnValue(
new SFUInt32::GetHandle(
- &_sfZoffset,
- this->getType().getFieldDesc(ZoffsetFieldId),
+ &_sfLayer,
+ this->getType().getFieldDesc(LayerFieldId),
const_cast(this)));
return returnValue;
}
-EditFieldHandlePtr LayeredTextureBufferBase::editHandleZoffset (void)
+EditFieldHandlePtr LayeredTextureBufferBase::editHandleLayer (void)
{
SFUInt32::EditHandlePtr returnValue(
new SFUInt32::EditHandle(
- &_sfZoffset,
- this->getType().getFieldDesc(ZoffsetFieldId),
+ &_sfLayer,
+ this->getType().getFieldDesc(LayerFieldId),
this));
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
return returnValue;
}
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.h ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.h
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.h 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.h 2016-07-25 10:01:04.230209900 +0200
@@ -99,8 +99,8 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
TextureFieldId = Inherited::NextFieldId,
TexTargetFieldId = TextureFieldId + 1,
LevelFieldId = TexTargetFieldId + 1,
- ZoffsetFieldId = LevelFieldId + 1,
- NextFieldId = ZoffsetFieldId + 1
+ LayerFieldId = LevelFieldId + 1,
+ NextFieldId = LayerFieldId + 1
};
static const OSG::BitVector TextureFieldMask =
@@ -109,15 +109,15 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
(TypeTraits::One << TexTargetFieldId);
static const OSG::BitVector LevelFieldMask =
(TypeTraits::One << LevelFieldId);
- static const OSG::BitVector ZoffsetFieldMask =
- (TypeTraits::One << ZoffsetFieldId);
+ static const OSG::BitVector LayerFieldMask =
+ (TypeTraits::One << LayerFieldId);
static const OSG::BitVector NextFieldMask =
(TypeTraits::One << NextFieldId);
typedef SFUnrecTextureObjChunkPtr SFTextureType;
typedef SFGLenum SFTexTargetType;
typedef SFUInt32 SFLevelType;
- typedef SFUInt32 SFZoffsetType;
+ typedef SFUInt32 SFLayerType;
/*---------------------------------------------------------------------*/
/*! \name Class Get */
@@ -151,8 +151,8 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
SFUInt32 *editSFLevel (void);
const SFUInt32 *getSFLevel (void) const;
- SFUInt32 *editSFZoffset (void);
- const SFUInt32 *getSFZoffset (void) const;
+ SFUInt32 *editSFLayer (void);
+ const SFUInt32 *getSFLayer (void) const;
TextureObjChunk * getTexture (void) const;
@@ -163,8 +163,8 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
UInt32 &editLevel (void);
UInt32 getLevel (void) const;
- UInt32 &editZoffset (void);
- UInt32 getZoffset (void) const;
+ UInt32 &editLayer (void);
+ UInt32 getLayer (void) const;
/*! \} */
/*---------------------------------------------------------------------*/
@@ -174,7 +174,7 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
void setTexture (TextureObjChunk * const value);
void setTexTarget (const GLenum &value);
void setLevel (const UInt32 value);
- void setZoffset (const UInt32 value);
+ void setLayer (const UInt32 value);
/*! \} */
/*---------------------------------------------------------------------*/
@@ -242,7 +242,7 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
SFUnrecTextureObjChunkPtr _sfTexture;
SFGLenum _sfTexTarget;
SFUInt32 _sfLevel;
- SFUInt32 _sfZoffset;
+ SFUInt32 _sfLayer;
/*! \} */
/*---------------------------------------------------------------------*/
@@ -277,8 +277,8 @@ class OSG_SYSTEM_DLLMAPPING LayeredTextu
EditFieldHandlePtr editHandleTexTarget (void);
GetFieldHandlePtr getHandleLevel (void) const;
EditFieldHandlePtr editHandleLevel (void);
- GetFieldHandlePtr getHandleZoffset (void) const;
- EditFieldHandlePtr editHandleZoffset (void);
+ GetFieldHandlePtr getHandleLayer (void) const;
+ EditFieldHandlePtr editHandleLayer (void);
/*! \} */
/*---------------------------------------------------------------------*/
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.inl ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.inl
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.inl 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGLayeredTextureBufferBase.inl 2016-07-25 10:01:04.214609900 +0200
@@ -124,30 +124,30 @@ void LayeredTextureBufferBase::setLevel(
_sfLevel.setValue(value);
}
-//! Get the value of the LayeredTextureBuffer::_sfZoffset field.
+//! Get the value of the LayeredTextureBuffer::_sfLayer field.
inline
-UInt32 &LayeredTextureBufferBase::editZoffset(void)
+UInt32 &LayeredTextureBufferBase::editLayer(void)
{
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
- return _sfZoffset.getValue();
+ return _sfLayer.getValue();
}
-//! Get the value of the LayeredTextureBuffer::_sfZoffset field.
+//! Get the value of the LayeredTextureBuffer::_sfLayer field.
inline
- UInt32 LayeredTextureBufferBase::getZoffset(void) const
+ UInt32 LayeredTextureBufferBase::getLayer(void) const
{
- return _sfZoffset.getValue();
+ return _sfLayer.getValue();
}
-//! Set the value of the LayeredTextureBuffer::_sfZoffset field.
+//! Set the value of the LayeredTextureBuffer::_sfLayer field.
inline
-void LayeredTextureBufferBase::setZoffset(const UInt32 value)
+void LayeredTextureBufferBase::setLayer(const UInt32 value)
{
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
- _sfZoffset.setValue(value);
+ _sfLayer.setValue(value);
}
@@ -170,8 +170,8 @@ void LayeredTextureBufferBase::execSync
if(FieldBits::NoField != (LevelFieldMask & whichField))
_sfLevel.syncWith(pFrom->_sfLevel);
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
- _sfZoffset.syncWith(pFrom->_sfZoffset);
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
+ _sfLayer.syncWith(pFrom->_sfLayer);
}
#endif
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.cpp ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.cpp
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.cpp 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.cpp 2016-07-25 10:44:24.163217600 +0200
@@ -59,10 +59,11 @@ OSG_BEGIN_NAMESPACE
UInt32 TextureBuffer::_uiFramebuffer_object_extension =
Window::invalidExtensionID;
-UInt32 TextureBuffer::_uiFuncFramebufferTexture1D = Window::invalidFunctionID;
-UInt32 TextureBuffer::_uiFuncFramebufferTexture2D = Window::invalidFunctionID;
-UInt32 TextureBuffer::_uiFuncFramebufferTexture3D = Window::invalidFunctionID;
-UInt32 TextureBuffer::_uiFuncGenerateMipmap = Window::invalidFunctionID;
+UInt32 TextureBuffer::_uiFuncFramebufferTexture1D = Window::invalidFunctionID;
+UInt32 TextureBuffer::_uiFuncFramebufferTexture2D = Window::invalidFunctionID;
+UInt32 TextureBuffer::_uiFuncFramebufferTexture3D = Window::invalidFunctionID;
+UInt32 TextureBuffer::_uiFuncFramebufferTextureLayer = Window::invalidFunctionID;
+UInt32 TextureBuffer::_uiFuncGenerateMipmap = Window::invalidFunctionID;
// Documentation for this class is emited in the
// OSGTextureBufferBase.cpp file.
@@ -144,9 +145,27 @@ void TextureBuffer::bind(DrawEnv *pEnv,
target,
pWindow->getGLObjectId(_sfTexture.getValue()->getGLId()),
getLevel(),
- getZoffset());
+ getLayer());
}
break;
+
+ case GL_TEXTURE_2D_ARRAY:
+ case GL_TEXTURE_CUBE_MAP_ARRAY:
+ {
+ OSGGETGLFUNCBYID_GL3( glFramebufferTextureLayer,
+ osgGlFramebufferTextureLayer,
+ _uiFuncFramebufferTextureLayer,
+ pWindow);
+
+ osgGlFramebufferTextureLayer(
+ GL_FRAMEBUFFER,
+ index,
+ pWindow->getGLObjectId(_sfTexture.getValue()->getGLId()),
+ getLevel(),
+ getLayer());
+ }
+ break;
+
}
}
}
@@ -364,6 +383,11 @@ void TextureBuffer::initMethod(InitPhase
OSG_DLSYM_UNDERSCORE"glFramebufferTexture3D",
_uiFramebuffer_object_extension);
+ _uiFuncFramebufferTextureLayer =
+ Window::registerFunction (
+ OSG_DLSYM_UNDERSCORE"glFramebufferTextureLayer",
+ _uiFramebuffer_object_extension);
+
_uiFuncGenerateMipmap =
Window::registerFunction (
OSG_DLSYM_UNDERSCORE"glGenerateMipmap",
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.fcd ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.fcd
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.fcd 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.fcd 2016-07-25 09:41:23.693135900 +0200
@@ -45,13 +45,13 @@
The mipmap level in the texture to target.
- UNUSED.
+ The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.h ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.h
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.h 2017-01-16 11:34:55.380939000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBuffer.h 2016-07-25 09:49:41.837211300 +0200
@@ -143,6 +143,7 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
static UInt32 _uiFuncFramebufferTexture1D;
static UInt32 _uiFuncFramebufferTexture2D;
static UInt32 _uiFuncFramebufferTexture3D;
+ static UInt32 _uiFuncFramebufferTextureLayer;
static UInt32 _uiFuncGenerateMipmap;
/*! \} */
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.cpp ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.cpp
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.cpp 2017-01-16 11:34:55.396539000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.cpp 2017-01-16 12:07:51.350607500 +0100
@@ -98,8 +98,8 @@ OSG_BEGIN_NAMESPACE
The mipmap level in the texture to target.
*/
-/*! \var UInt32 TextureBufferBase::_sfZoffset
- UNUSED.
+/*! \var UInt32 TextureBufferBase::_sfLayer
+ The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.
*/
@@ -173,13 +173,13 @@ void TextureBufferBase::classDescInserte
pDesc = new SFUInt32::Description(
SFUInt32::getClassType(),
- "zoffset",
- "UNUSED.\n",
- ZoffsetFieldId, ZoffsetFieldMask,
+ "layer",
+ "The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.\n",
+ LayerFieldId, LayerFieldMask,
false,
(Field::SFDefaultFlags | Field::FStdAccess),
- static_cast(&TextureBuffer::editHandleZoffset),
- static_cast(&TextureBuffer::getHandleZoffset));
+ static_cast(&TextureBuffer::editHandleLayer),
+ static_cast(&TextureBuffer::getHandleLayer));
oType.addInitialDesc(pDesc);
}
@@ -243,14 +243,14 @@ TextureBufferBase::TypeObject TextureBuf
" The mipmap level in the texture to target.\n"
" \n"
" \n"
- " UNUSED.\n"
+ " The layer specifies the layer of a 2-dimensional image within a 3-dimensional texture.\n"
" \n"
"\n",
"Texture buffer. Wraps support to binding a framebuffer attachment to an OpenSG texture object.\n"
@@ -332,16 +332,16 @@ const SFUInt32 *TextureBufferBase::getSF
}
-SFUInt32 *TextureBufferBase::editSFZoffset(void)
+SFUInt32 *TextureBufferBase::editSFLayer(void)
{
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
- return &_sfZoffset;
+ return &_sfLayer;
}
-const SFUInt32 *TextureBufferBase::getSFZoffset(void) const
+const SFUInt32 *TextureBufferBase::getSFLayer(void) const
{
- return &_sfZoffset;
+ return &_sfLayer;
}
@@ -367,9 +367,9 @@ SizeT TextureBufferBase::getBinSize(Cons
{
returnValue += _sfLevel.getBinSize();
}
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
{
- returnValue += _sfZoffset.getBinSize();
+ returnValue += _sfLayer.getBinSize();
}
return returnValue;
@@ -392,9 +392,9 @@ void TextureBufferBase::copyToBin(Binary
{
_sfLevel.copyToBin(pMem);
}
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
{
- _sfZoffset.copyToBin(pMem);
+ _sfLayer.copyToBin(pMem);
}
}
@@ -418,10 +418,10 @@ void TextureBufferBase::copyFromBin(Bina
editSField(LevelFieldMask);
_sfLevel.copyFromBin(pMem);
}
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
{
- editSField(ZoffsetFieldMask);
- _sfZoffset.copyFromBin(pMem);
+ editSField(LayerFieldMask);
+ _sfLayer.copyFromBin(pMem);
}
}
@@ -551,7 +551,7 @@ TextureBufferBase::TextureBufferBase(voi
_sfTexture (NULL),
_sfTexTarget (GLenum(GL_NONE)),
_sfLevel (UInt32(0)),
- _sfZoffset (UInt32(0))
+ _sfLayer (UInt32(0))
{
}
@@ -560,7 +560,7 @@ TextureBufferBase::TextureBufferBase(con
_sfTexture (NULL),
_sfTexTarget (source._sfTexTarget ),
_sfLevel (source._sfLevel ),
- _sfZoffset (source._sfZoffset )
+ _sfLayer (source._sfLayer )
{
}
@@ -661,27 +661,27 @@ EditFieldHandlePtr TextureBufferBase::ed
return returnValue;
}
-GetFieldHandlePtr TextureBufferBase::getHandleZoffset (void) const
+GetFieldHandlePtr TextureBufferBase::getHandleLayer (void) const
{
SFUInt32::GetHandlePtr returnValue(
new SFUInt32::GetHandle(
- &_sfZoffset,
- this->getType().getFieldDesc(ZoffsetFieldId),
+ &_sfLayer,
+ this->getType().getFieldDesc(LayerFieldId),
const_cast(this)));
return returnValue;
}
-EditFieldHandlePtr TextureBufferBase::editHandleZoffset (void)
+EditFieldHandlePtr TextureBufferBase::editHandleLayer (void)
{
SFUInt32::EditHandlePtr returnValue(
new SFUInt32::EditHandle(
- &_sfZoffset,
- this->getType().getFieldDesc(ZoffsetFieldId),
+ &_sfLayer,
+ this->getType().getFieldDesc(LayerFieldId),
this));
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
return returnValue;
}
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.h ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.h
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.h 2017-01-16 11:34:55.396539000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.h 2016-07-25 10:00:50.470985700 +0200
@@ -99,8 +99,8 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
TextureFieldId = Inherited::NextFieldId,
TexTargetFieldId = TextureFieldId + 1,
LevelFieldId = TexTargetFieldId + 1,
- ZoffsetFieldId = LevelFieldId + 1,
- NextFieldId = ZoffsetFieldId + 1
+ LayerFieldId = LevelFieldId + 1,
+ NextFieldId = LayerFieldId + 1
};
static const OSG::BitVector TextureFieldMask =
@@ -109,15 +109,15 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
(TypeTraits::One << TexTargetFieldId);
static const OSG::BitVector LevelFieldMask =
(TypeTraits::One << LevelFieldId);
- static const OSG::BitVector ZoffsetFieldMask =
- (TypeTraits::One << ZoffsetFieldId);
+ static const OSG::BitVector LayerFieldMask =
+ (TypeTraits::One << LayerFieldId);
static const OSG::BitVector NextFieldMask =
(TypeTraits::One << NextFieldId);
typedef SFUnrecTextureObjChunkPtr SFTextureType;
typedef SFGLenum SFTexTargetType;
typedef SFUInt32 SFLevelType;
- typedef SFUInt32 SFZoffsetType;
+ typedef SFUInt32 SFLayerType;
/*---------------------------------------------------------------------*/
/*! \name Class Get */
@@ -151,8 +151,8 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
SFUInt32 *editSFLevel (void);
const SFUInt32 *getSFLevel (void) const;
- SFUInt32 *editSFZoffset (void);
- const SFUInt32 *getSFZoffset (void) const;
+ SFUInt32 *editSFLayer (void);
+ const SFUInt32 *getSFLayer (void) const;
TextureObjChunk * getTexture (void) const;
@@ -163,8 +163,8 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
UInt32 &editLevel (void);
UInt32 getLevel (void) const;
- UInt32 &editZoffset (void);
- UInt32 getZoffset (void) const;
+ UInt32 &editLayer (void);
+ UInt32 getLayer (void) const;
/*! \} */
/*---------------------------------------------------------------------*/
@@ -174,7 +174,7 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
void setTexture (TextureObjChunk * const value);
void setTexTarget (const GLenum &value);
void setLevel (const UInt32 value);
- void setZoffset (const UInt32 value);
+ void setLayer (const UInt32 value);
/*! \} */
/*---------------------------------------------------------------------*/
@@ -242,7 +242,7 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
SFUnrecTextureObjChunkPtr _sfTexture;
SFGLenum _sfTexTarget;
SFUInt32 _sfLevel;
- SFUInt32 _sfZoffset;
+ SFUInt32 _sfLayer;
/*! \} */
/*---------------------------------------------------------------------*/
@@ -277,8 +277,8 @@ class OSG_SYSTEM_DLLMAPPING TextureBuffe
EditFieldHandlePtr editHandleTexTarget (void);
GetFieldHandlePtr getHandleLevel (void) const;
EditFieldHandlePtr editHandleLevel (void);
- GetFieldHandlePtr getHandleZoffset (void) const;
- EditFieldHandlePtr editHandleZoffset (void);
+ GetFieldHandlePtr getHandleLayer (void) const;
+ EditFieldHandlePtr editHandleLayer (void);
/*! \} */
/*---------------------------------------------------------------------*/
diff -rupN ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.inl ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.inl
--- ./opensg_org/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.inl 2017-01-16 11:34:55.396539000 +0100
+++ ./opensg_texture/Source/System/Window/FrameBufferObjects/OSGTextureBufferBase.inl 2016-07-25 10:00:50.470985700 +0200
@@ -124,30 +124,30 @@ void TextureBufferBase::setLevel(const U
_sfLevel.setValue(value);
}
-//! Get the value of the TextureBuffer::_sfZoffset field.
+//! Get the value of the TextureBuffer::_sfLayer field.
inline
-UInt32 &TextureBufferBase::editZoffset(void)
+UInt32 &TextureBufferBase::editLayer(void)
{
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
- return _sfZoffset.getValue();
+ return _sfLayer.getValue();
}
-//! Get the value of the TextureBuffer::_sfZoffset field.
+//! Get the value of the TextureBuffer::_sfLayer field.
inline
- UInt32 TextureBufferBase::getZoffset(void) const
+ UInt32 TextureBufferBase::getLayer(void) const
{
- return _sfZoffset.getValue();
+ return _sfLayer.getValue();
}
-//! Set the value of the TextureBuffer::_sfZoffset field.
+//! Set the value of the TextureBuffer::_sfLayer field.
inline
-void TextureBufferBase::setZoffset(const UInt32 value)
+void TextureBufferBase::setLayer(const UInt32 value)
{
- editSField(ZoffsetFieldMask);
+ editSField(LayerFieldMask);
- _sfZoffset.setValue(value);
+ _sfLayer.setValue(value);
}
@@ -170,8 +170,8 @@ void TextureBufferBase::execSync (
if(FieldBits::NoField != (LevelFieldMask & whichField))
_sfLevel.syncWith(pFrom->_sfLevel);
- if(FieldBits::NoField != (ZoffsetFieldMask & whichField))
- _sfZoffset.syncWith(pFrom->_sfZoffset);
+ if(FieldBits::NoField != (LayerFieldMask & whichField))
+ _sfLayer.syncWith(pFrom->_sfLayer);
}
#endif