MCPcopy Create free account
hub / github.com/axmolengine/axmol / updateTextureDescriptor

Method updateTextureDescriptor

core/renderer/Texture2D.cpp:580–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578}
579
580bool Texture2D::updateTextureDescriptor(const backend::TextureDescriptor& descriptor, bool preMultipliedAlpha)
581{
582 AX_ASSERT(_texture);
583
584 _texture->updateTextureDescriptor(descriptor);
585 _pixelsWide = _contentSize.width = _texture->getWidth();
586 _pixelsHigh = _contentSize.height = _texture->getHeight();
587 setPremultipliedAlpha(preMultipliedAlpha);
588
589 setRenderTarget(descriptor.textureUsage == TextureUsage::RENDER_TARGET);
590
591 if (_pixelFormat == PixelFormat::NONE)
592 _pixelFormat = descriptor.textureFormat;
593
594 return true;
595}
596
597void Texture2D::setRenderTarget(bool renderTarget)
598{

Calls 3

setRenderTargetFunction · 0.85
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected