Commit 53320bc1 authored by Robert Menzel's avatar Robert Menzel

removed deprecated Texture interface

parent 2b7cada1
......@@ -238,19 +238,6 @@ public:
//! sets a texture uniform to a given texture unit and also binds the texture to the same unit
inline void setTexture (GLint _location, const ConstSharedTextureBase& _texture, GLint _unit) const { glUniform1i(_location, _unit); _texture->bind(_unit); }
inline void setTexture (const std::string& _nameInShader, const ConstSharedTextureBase& _texture, GLint _unit) const { setUniform( getUniformLocation(_nameInShader), (GLint) _unit); _texture->bind(_unit); }
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
//! set the texture to the texture unit the uniform is set to.
//! Note: it is not guaranteed that all uniforms for textures are set to unique samplers by default after linking!
void setTexture( const std::string& _nameInShader, const ConstSharedTexture& _texture ) const {
GLint unit;
GLint uniformLocation = getUniformLocation(_nameInShader);
if ( uniformLocation != -1 ) {
glGetUniformiv( mObjectName, uniformLocation, &unit );
_texture->bind( unit );
}
}
#endif
#if (ACGL_OPENGL_VERSION >= 41)
// DSA versions:
......
This diff is collapsed.
......@@ -725,51 +725,3 @@ void TextureBase::texSubImage3D( const SharedTextureData &_data, GLint _mipmapLe
openGLRareError();
}
#ifdef ACGL_INCLUDE_DEPRECATED_FUNCTIONALITY
//////////////////////////////////////////////////////////////////////////
//
// old Texture class:
#ifndef ACGL_OPENGLES_VERSION_20
SharedTextureData Texture::getImageData(GLint _lod, GLenum _type) const
{
Image img;
img.mipmapLevel = _lod;
return getTextureImage( img, mFormat, _type );
/*
if(_type == GL_INVALID_ENUM) _type = mType;
// remember the previously bound texture and bind this one
GLuint prevTexture = bindAndGetOldTexture();
// determine the required buffer size to hold the requested LOD level
GLint width, height, depth;
glGetTexLevelParameteriv(mTarget, _lod, GL_TEXTURE_WIDTH, &width);
glGetTexLevelParameteriv(mTarget, _lod, GL_TEXTURE_HEIGHT, &height);
glGetTexLevelParameteriv(mTarget, _lod, GL_TEXTURE_DEPTH, &depth);
// fetch the image data
int channels = 4;
if (mFormat == GL_RGB) channels = 3; // TODO: check the other channel types
GLubyte* imageData = new GLubyte[width * height * getGLTypeSize(_type) * channels];
glGetTexImage(mTarget, _lod, mFormat, _type, (GLvoid*)imageData);
// revert to the previously bound texture
glBindTexture(mTarget, prevTexture);
// store the image data and meta information in a TextureData object
SharedTextureData dataObject = SharedTextureData(new TextureData());
dataObject->setWidth(width);
dataObject->setHeight(height);
dataObject->setDepth(depth);
dataObject->setType(_type);
dataObject->setFormat(mFormat);
dataObject->setData(imageData); // dataObject will take care of freeing imageData
return dataObject;
*/
}
#endif // ES 2.0
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment