MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / LoadTextureLevel

Method LoadTextureLevel

GTE/Graphics/GL46/GL46TextureCubeArray.cpp:108–129  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108void GL46TextureCubeArray::LoadTextureLevel(uint32_t item, uint32_t level, void const* data)
109{
110 auto texture = GetTexture();
111 if (texture && level < texture->GetNumLevels())
112 {
113 auto const width = texture->GetDimensionFor(level, 0);
114 auto const height = texture->GetDimensionFor(level, 1);
115
116 // Determine cube and face indexes from the item index.
117 auto const cube = texture->GetCubeIndexFor(item);
118 auto const face = texture->GetFaceIndexFor(item);
119
120 // Each face in the TextureCubeArray has a unique GL target.
121 GLenum targetFace = msCubeFaceTarget[face];
122
123 // For TextureCubeArray, use the 3D calls where the cube index is the
124 // third dimension. Only updating one cube-face for the specified
125 // level.
126 glTexSubImage3D(targetFace, level, 0, 0, cube, width, height, 1,
127 mExternalFormat, mExternalType, data);
128 }
129}
130
131

Callers

nothing calls this directly

Calls 5

glTexSubImage3DFunction · 0.85
GetNumLevelsMethod · 0.80
GetDimensionForMethod · 0.80
GetCubeIndexForMethod · 0.80
GetFaceIndexForMethod · 0.80

Tested by

no test coverage detected