| 856 | } |
| 857 | |
| 858 | void Texture1d::update( const Surface8u &surface, int mipLevel ) |
| 859 | { |
| 860 | GLint dataFormat; |
| 861 | GLenum type; |
| 862 | SurfaceChannelOrderToDataFormatAndType<uint8_t>( surface.getChannelOrder(), &dataFormat, &type ); |
| 863 | |
| 864 | ivec2 mipMapSize = calcMipLevelSize( mipLevel, getWidth(), getHeight() ); |
| 865 | if( surface.getSize() != mipMapSize ) |
| 866 | throw TextureResizeExc( "Invalid Texture1d::update() surface dimensions", surface.getSize(), mipMapSize ); |
| 867 | |
| 868 | ScopedTextureBind tbs( mTarget, mTextureId ); |
| 869 | glTexSubImage1D( mTarget, mipLevel, 0, // offsets |
| 870 | mipMapSize.x, dataFormat, type, surface.getData() ); |
| 871 | } |
| 872 | |
| 873 | void Texture1d::update( const void *data, GLenum dataFormat, GLenum dataType, int mipLevel, int width, int offset ) |
| 874 | { |
no test coverage detected