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

Function ILAPIENTRY ilRegisterNumImages

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

Source from the content-addressed store, hash-verified

340
341
342ILboolean ILAPIENTRY ilRegisterNumImages(ILuint Num)
343{
344 ILimage *Next, *Prev;
345
346 ilBindImage(ilGetCurName()); // Make sure the current image is actually bound.
347 ilCloseImage(iCurImage->Next); // Close any current "next" images.
348
349 iCurImage->Next = NULL;
350 if (Num == 0) // Just gets rid of all the "next" images.
351 return IL_TRUE;
352
353 iCurImage->Next = ilNewImage(1, 1, 1, 1, 1);
354 if (iCurImage->Next == NULL)
355 return IL_FALSE;
356 Next = iCurImage->Next;
357 Num--;
358
359 while (Num) {
360 Next->Next = ilNewImage(1, 1, 1, 1, 1);
361 if (Next->Next == NULL) {
362 // Clean up before we error out.
363 Prev = iCurImage->Next;
364 while (Prev) {
365 Next = Prev->Next;
366 ilCloseImage(Prev);
367 Prev = Next;
368 }
369 return IL_FALSE;
370 }
371 Next = Next->Next;
372 Num--;
373 }
374
375 return IL_TRUE;
376}
377
378
379void ILAPIENTRY ilRegisterType(ILenum Type)

Callers

nothing calls this directly

Calls 2

ilGetCurNameFunction · 0.85
ilCloseImageFunction · 0.85

Tested by

no test coverage detected