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

Function ILAPIENTRY ilActiveImage

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

Used for setting the current image if it is an animation.

Source from the content-addressed store, hash-verified

339
340//! Used for setting the current image if it is an animation.
341ILboolean ILAPIENTRY ilActiveImage(ILuint Number)
342{
343 ILuint Current;
344 ILimage *iTempImage;
345
346 if (iCurImage == NULL) {
347 ilSetError(IL_ILLEGAL_OPERATION);
348 return IL_FALSE;
349 }
350
351 if (Number == 0) {
352 return IL_TRUE;
353 }
354
355 iTempImage = iCurImage;
356 iCurImage = iCurImage->Next;
357 if (iCurImage == NULL) {
358 iCurImage = iTempImage;
359 ilSetError(IL_ILLEGAL_OPERATION);
360 return IL_FALSE;
361 }
362
363 Number--; // Skip 0 (parent image)
364 for (Current = 0; Current < Number; Current++) {
365 iCurImage = iCurImage->Next;
366 if (iCurImage == NULL) {
367 ilSetError(IL_ILLEGAL_OPERATION);
368 iCurImage = iTempImage;
369 return IL_FALSE;
370 }
371 }
372
373 ParentImage = IL_FALSE;
374
375 return IL_TRUE;
376}
377
378
379//! Used for setting the current face if it is a cubemap.

Callers

nothing calls this directly

Calls 1

ilSetErrorFunction · 0.85

Tested by

no test coverage detected