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

Method Update

GTE/Graphics/GL46/GL46TextureSingle.cpp:80–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80bool GL46TextureSingle::Update()
81{
82 auto texture = GetTexture();
83
84 if (CanAutoGenerateMipmaps())
85 {
86 // Only update the level 0 texture and then generate the remaining
87 // mipmaps from it.
88 if (!Update(0))
89 {
90 return false;
91 }
92 GenerateMipmaps();
93 }
94 else
95 {
96 // Automatic generation of mipmaps is not enabled, so all mipmap
97 // levels must be copied to the GPU.
98 auto const numLevels = texture->GetNumLevels();
99 for (uint32_t level = 0; level < numLevels; ++level)
100 {
101 if (!Update(level))
102 {
103 return false;
104 }
105 }
106 }
107
108 return true;
109}
110
111bool GL46TextureSingle::CopyCpuToGpu()
112{

Callers

nothing calls this directly

Calls 2

GetNumLevelsMethod · 0.80
GetUsageMethod · 0.45

Tested by

no test coverage detected