MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / TextureLoaderRaw

Method TextureLoaderRaw

Sources/nCine/Graphics/TextureLoaderRaw.cpp:5–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3namespace nCine
4{
5 TextureLoaderRaw::TextureLoaderRaw(std::int32_t width, std::int32_t height, std::int32_t mipMapCount, GLenum internalFormat)
6 : ITextureLoader()
7 {
8 width_ = width;
9 height_ = height;
10 mipMapCount_ = mipMapCount;
11 texFormat_ = TextureFormat(internalFormat);
12
13 std::int32_t numPixels = width * height;
14 std::int32_t bytesPerPixel = texFormat_.numChannels();
15 for (std::int32_t i = 0; i < mipMapCount_; i++) {
16 dataSize_ += numPixels * bytesPerPixel;
17 numPixels /= 2;
18 }
19
20 hasLoaded_ = true;
21 }
22}

Callers

nothing calls this directly

Calls 2

TextureFormatClass · 0.85
numChannelsMethod · 0.45

Tested by

no test coverage detected