Commit 49ca2fa3 authored by Robert Menzel's avatar Robert Menzel

cube map texture fix

parent 7bc88cfe
......@@ -408,8 +408,8 @@ ACGL_SMARTPOINTER_TYPEDEFS(Texture2DArray)
class TextureCubeMap : public TextureBase
{
public:
TextureCubeMap( GLenum _internalFormat = GL_RGBA ) : TextureBase( GL_TEXTURE_BINDING_CUBE_MAP, _internalFormat ) {}
TextureCubeMap( const glm::uvec2 &_size, GLenum _internalFormat = GL_RGBA ) : TextureBase( GL_TEXTURE_BINDING_CUBE_MAP, _internalFormat )
TextureCubeMap( GLenum _internalFormat = GL_RGBA ) : TextureBase( GL_TEXTURE_CUBE_MAP, _internalFormat ) {}
TextureCubeMap( const glm::uvec2 &_size, GLenum _internalFormat = GL_RGBA ) : TextureBase( GL_TEXTURE_CUBE_MAP, _internalFormat )
{
resize( _size );
}
......
......@@ -523,11 +523,15 @@ void TextureCubeMap::setImageData( const SharedTextureData &_data, GLenum _cubeS
std::cerr << "can't set cubemap side as provided enum does not name a side!" << std::endl;
return;
}
if (!textureStorageIsAllocated()) {
texImage2DCube( _data, _cubeSide, _mipmapLayer );
} else {
texSubImage2DCube( _data, _cubeSide, _mipmapLayer );
if (!_data) {
std::cerr << "can't set cubemap side as data is invalid" << std::endl;
return;
}
//if (!textureStorageIsAllocated()) {
texImage2DCube( _data, _cubeSide, _mipmapLayer );
///} else {
// texSubImage2DCube( _data, _cubeSide, _mipmapLayer );
//}
}
void TextureCubeMap::resize( const glm::uvec2 &_newSize )
......
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