MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY ilActiveMipmap

Function ILAPIENTRY ilActiveMipmap

DevIL/src-IL/src/il_stack.cpp:303–337  ·  view source on GitHub ↗

Sets the current mipmap level

Source from the content-addressed store, hash-verified

301
302//! Sets the current mipmap level
303ILboolean ILAPIENTRY ilActiveMipmap(ILuint Number)
304{
305 ILuint Current;
306 ILimage *iTempImage;
307
308 if (iCurImage == NULL) {
309 ilSetError(IL_ILLEGAL_OPERATION);
310 return IL_FALSE;
311 }
312
313 if (Number == 0) {
314 return IL_TRUE;
315 }
316
317 iTempImage = iCurImage;
318 iCurImage = iCurImage->Mipmaps;
319 if (iCurImage == NULL) {
320 iCurImage = iTempImage;
321 ilSetError(IL_ILLEGAL_OPERATION);
322 return IL_FALSE;
323 }
324
325 for (Current = 1; Current < Number; Current++) {
326 iCurImage = iCurImage->Mipmaps;
327 if (iCurImage == NULL) {
328 ilSetError(IL_ILLEGAL_OPERATION);
329 iCurImage = iTempImage;
330 return IL_FALSE;
331 }
332 }
333
334 ParentImage = IL_FALSE;
335
336 return IL_TRUE;
337}
338
339
340//! Used for setting the current image if it is an animation.

Callers

nothing calls this directly

Calls 1

ilSetErrorFunction · 0.85

Tested by

no test coverage detected