|
|
|
@ -238,13 +238,15 @@ void Texture1D::apply(State& state) const
|
|
|
|
|
textureObject = generateAndAssignTextureObject(contextID, GL_TEXTURE_1D, _numMipmapLevels, texStorageSizedInternalFormat, _textureWidth, 1, 1, 0);
|
|
|
|
|
textureObject->bind();
|
|
|
|
|
applyTexParameters(GL_TEXTURE_1D, state);
|
|
|
|
|
|
|
|
|
|
extensions->glTexStorage1D( GL_TEXTURE_1D, osg::maximum(_numMipmapLevels,1), texStorageSizedInternalFormat, _textureWidth);
|
|
|
|
|
if(!textureObject->_allocated)
|
|
|
|
|
{
|
|
|
|
|
extensions->glTexStorage1D( GL_TEXTURE_1D, osg::maximum(_numMipmapLevels,1), texStorageSizedInternalFormat, _textureWidth);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
GLenum internalFormat = _sourceFormat ? _sourceFormat : _internalFormat;
|
|
|
|
|
textureObject = generateAndAssignTextureObject(contextID, GL_TEXTURE_1D, _numMipmapLevels, internalFormat, _textureWidth, 1, 1, 0);
|
|
|
|
|
textureObject = generateAndAssignTextureObject(contextID, GL_TEXTURE_1D, _numMipmapLevels, internalFormat, _textureWidth, 1, 1, _borderWidth);
|
|
|
|
|
textureObject->bind();
|
|
|
|
|
applyTexParameters(GL_TEXTURE_1D, state);
|
|
|
|
|
|
|
|
|
@ -260,6 +262,8 @@ void Texture1D::apply(State& state) const
|
|
|
|
|
_readPBuffer->bindPBufferToTexture(GL_FRONT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
textureObject->setAllocated(_numMipmapLevels, texStorageSizedInternalFormat!=0? texStorageSizedInternalFormat: _internalFormat, _textureWidth, 1, 1, _borderWidth);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|