MCPcopy Create free account
hub / github.com/cinder/Cinder / update

Method update

src/cinder/gl/Texture.cpp:858–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

856}
857
858void 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
873void Texture1d::update( const void *data, GLenum dataFormat, GLenum dataType, int mipLevel, int width, int offset )
874{

Callers 1

cacheMethod · 0.45

Calls 12

replaceFunction · 0.85
getDataStorePtrMethod · 0.80
getInternalFormatMethod · 0.80
getWidthFunction · 0.50
getHeightFunction · 0.50
updateFunction · 0.50
getBoundsFunction · 0.50
getChannelOrderMethod · 0.45
getSizeMethod · 0.45
getDataMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected