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

Method GenerateMipmaps

GTE/Graphics/GL46/GL46TextureArray.cpp:249–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249bool GL46TextureArray::GenerateMipmaps()
250{
251 if (CanAutoGenerateMipmaps())
252 {
253 // Save current binding for this texture target in order to restore it
254 // when done because the gl texture object is needed to be bound to
255 // this texture target for the operations to follow.
256 GLint prevBinding;
257 glGetIntegerv(mTargetBinding, &prevBinding);
258 glBindTexture(mTarget, mGLHandle);
259
260 // Generate the mipmaps. All of this binding save and restore is not
261 // necessary in OpenGL 4.6, where glGenerateTextureMipamap(mGLHandle)
262 // can simply be used.
263 glGenerateMipmap(mTarget);
264
265 glBindTexture(mTarget, prevBinding);
266
267 return true;
268 }
269 return false;
270}
271
272bool GL46TextureArray::DoCopyCpuToGpu(uint32_t item, uint32_t level)
273{

Callers 1

DisableMethod · 0.45

Calls 3

glGetIntegervFunction · 0.85
glBindTextureFunction · 0.85
glGenerateMipmapFunction · 0.85

Tested by

no test coverage detected