~ubuntu-branches/ubuntu/hoary/devil/hoary

« back to all changes in this revision

Viewing changes to cpp wrapper/il_wrap.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Marcelo E. Magallon
  • Date: 2005-01-03 19:57:42 UTC
  • Revision ID: james.westby@ubuntu.com-20050103195742-4ipkplcwygu3irv0
Tags: upstream-1.6.7
ImportĀ upstreamĀ versionĀ 1.6.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#define _IL_WRAP_BUILD_LIB
 
2
#include <il/il_wrap.h>
 
3
 
 
4
//#define TEST_WRAPPER  // Comment-out to get rid of main()
 
5
 
 
6
#ifdef TEST_WRAPPER
 
7
#include <iostream.h>
 
8
 
 
9
int main(int argc, char **argv)
 
10
{
 
11
        if (argc < 2) {
 
12
                cout << "Please specify a filename." << endl;
 
13
                return 1;
 
14
        }
 
15
 
 
16
        ilImage Image(argv[1]);
 
17
 
 
18
        cout << Image.Width() << ' ' << Image.Height() << ' ' << (ILuint)Image.Bpp() << endl;
 
19
 
 
20
        ilEnable(IL_FILE_OVERWRITE);
 
21
 
 
22
        Image.Save("test.tga");
 
23
 
 
24
        return 0;
 
25
}
 
26
#endif
 
27
 
 
28
 
 
29
//
 
30
//
 
31
// ILIMAGE
 
32
//
 
33
//
 
34
 
 
35
ilImage::ilImage()
 
36
{
 
37
        this->Id = 0;
 
38
        //this->iStartUp();
 
39
        this->iGenBind();
 
40
        return;
 
41
}
 
42
 
 
43
 
 
44
ilImage::ilImage(char *FileName)
 
45
{
 
46
        this->Id = 0;
 
47
        //this->iStartUp();
 
48
        this->iGenBind();
 
49
        ilLoadImage(FileName);
 
50
        return;
 
51
}
 
52
 
 
53
 
 
54
ilImage::ilImage(const ilImage &Image)
 
55
{
 
56
        this->Id = 0;
 
57
        //this->iStartUp();
 
58
        this->iGenBind();
 
59
        *this = Image;
 
60
        return;
 
61
}
 
62
 
 
63
 
 
64
ilImage::~ilImage()
 
65
{
 
66
        if (this->Id)
 
67
                ilDeleteImages(1, &this->Id);
 
68
        this->Id = 0;
 
69
        return;
 
70
}
 
71
 
 
72
 
 
73
ILboolean ilImage::Load(char *FileName)
 
74
{
 
75
        this->iGenBind();
 
76
        return ilLoadImage(FileName);
 
77
}
 
78
 
 
79
 
 
80
ILboolean ilImage::Load(char *FileName, ILenum Type)
 
81
{
 
82
        this->iGenBind();
 
83
        return ilLoad(Type, FileName);
 
84
}
 
85
 
 
86
 
 
87
ILboolean ilImage::Save(char *FileName)
 
88
{
 
89
        this->iGenBind();
 
90
        return ilSaveImage(FileName);
 
91
}
 
92
 
 
93
 
 
94
ILboolean ilImage::Save(char *FileName, ILenum Type)
 
95
{
 
96
        this->iGenBind();
 
97
        return ilSave(Type, FileName);
 
98
}
 
99
 
 
100
 
 
101
 
 
102
//
 
103
// ImageLib functions
 
104
//
 
105
 
 
106
ILboolean ilImage::ActiveImage(ILuint Number)
 
107
{
 
108
        if (this->Id) {
 
109
                this->Bind();
 
110
                return ilActiveImage(Number);
 
111
        }
 
112
        return IL_FALSE;
 
113
}
 
114
 
 
115
 
 
116
ILboolean ilImage::ActiveLayer(ILuint Number)
 
117
{
 
118
        if (this->Id) {
 
119
                this->Bind();
 
120
                return ilActiveLayer(Number);
 
121
        }
 
122
        return IL_FALSE;
 
123
}
 
124
 
 
125
 
 
126
ILboolean ilImage::ActiveMipmap(ILuint Number)
 
127
{
 
128
        if (this->Id) {
 
129
                this->Bind();
 
130
                return ilActiveMipmap(Number);
 
131
        }
 
132
        return IL_FALSE;
 
133
}
 
134
 
 
135
 
 
136
ILboolean ilImage::Clear()
 
137
{
 
138
        if (this->Id) {
 
139
                this->Bind();
 
140
                return ilClearImage();
 
141
        }
 
142
        return IL_FALSE;
 
143
}
 
144
 
 
145
 
 
146
ILvoid ilImage::ClearColour(ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha)
 
147
{
 
148
        ilClearColour(Red, Green, Blue, Alpha);
 
149
        return;
 
150
}
 
151
 
 
152
 
 
153
ILboolean ilImage::Convert(ILenum NewFormat)
 
154
{
 
155
        if (this->Id) {
 
156
                this->Bind();
 
157
                return ilConvertImage(NewFormat, IL_UNSIGNED_BYTE);
 
158
        }
 
159
        return IL_FALSE;
 
160
}
 
161
 
 
162
 
 
163
ILboolean ilImage::Copy(ILuint Src)
 
164
{
 
165
        if (this->Id) {
 
166
                this->Bind();
 
167
                return ilCopyImage(Src);
 
168
        }
 
169
        return IL_FALSE;
 
170
}
 
171
 
 
172
 
 
173
ILboolean ilImage::Default()
 
174
{
 
175
        if (this->Id) {
 
176
                this->Bind();
 
177
                return ilDefaultImage();
 
178
        }
 
179
        return IL_FALSE;
 
180
}
 
181
 
 
182
 
 
183
ILboolean ilImage::Flip()
 
184
{
 
185
        if (this->Id) {
 
186
                this->Bind();
 
187
                return iluFlipImage();
 
188
        }
 
189
        return IL_FALSE;
 
190
}
 
191
 
 
192
 
 
193
ILboolean ilImage::SwapColours()
 
194
{
 
195
        if (this->Id) {
 
196
                this->Bind();
 
197
                return iluSwapColours();
 
198
        }
 
199
        return IL_FALSE;
 
200
}
 
201
 
 
202
 
 
203
ILboolean ilImage::Resize(ILuint Width, ILuint Height, ILuint Depth)
 
204
{
 
205
        if (this->Id) {
 
206
                this->Bind();
 
207
                return iluScale(Width, Height, Depth);
 
208
        }
 
209
        return IL_FALSE;
 
210
}
 
211
 
 
212
 
 
213
ILboolean ilImage::TexImage(ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data)
 
214
{
 
215
        if (this->Id) {
 
216
                this->Bind();
 
217
                return ilTexImage(Width, Height, Depth, Bpp, Format, Type, Data);
 
218
        }
 
219
        return IL_FALSE;
 
220
}
 
221
 
 
222
 
 
223
 
 
224
//
 
225
// Image handling
 
226
//
 
227
 
 
228
ILvoid ilImage::Bind() const
 
229
{
 
230
        if (this->Id)
 
231
                ilBindImage(this->Id);
 
232
        return;
 
233
}
 
234
 
 
235
 
 
236
// Note:  Behaviour may be changed!
 
237
ILvoid ilImage::Bind(ILuint Image)
 
238
{
 
239
        if (this->Id == Image)
 
240
                return;
 
241
        this->Delete();  // Should we delete it?
 
242
        this->Id = Image;
 
243
        ilBindImage(this->Id);
 
244
        return;
 
245
}
 
246
 
 
247
 
 
248
ILvoid ilImage::Delete()
 
249
{
 
250
        if (this->Id == 0)
 
251
                return;
 
252
        ilDeleteImages(1, &this->Id);
 
253
        this->Id = 0;
 
254
        return;
 
255
}
 
256
 
 
257
 
 
258
 
 
259
 
 
260
//
 
261
// Image characteristics
 
262
//
 
263
 
 
264
ILuint ilImage::Width()
 
265
{
 
266
        if (this->Id) {
 
267
                this->Bind();
 
268
                return ilGetInteger(IL_IMAGE_WIDTH);
 
269
        }
 
270
        return 0;
 
271
}
 
272
 
 
273
 
 
274
ILuint ilImage::Height()
 
275
{
 
276
        if (this->Id) {
 
277
                this->Bind();
 
278
                return ilGetInteger(IL_IMAGE_HEIGHT);
 
279
        }
 
280
        return 0;
 
281
}
 
282
 
 
283
 
 
284
ILuint ilImage::Depth()
 
285
{
 
286
        if (this->Id) {
 
287
                this->Bind();
 
288
                return ilGetInteger(IL_IMAGE_DEPTH);
 
289
        }
 
290
        return 0;
 
291
}
 
292
 
 
293
 
 
294
ILubyte ilImage::Bpp()
 
295
{
 
296
        if (this->Id) {
 
297
                this->Bind();
 
298
                return ilGetInteger(IL_IMAGE_BYTES_PER_PIXEL);
 
299
        }
 
300
        return 0;
 
301
}
 
302
 
 
303
 
 
304
ILubyte ilImage::Bitpp()
 
305
{
 
306
        if (this->Id) {
 
307
                this->Bind();
 
308
                return ilGetInteger(IL_IMAGE_BITS_PER_PIXEL);
 
309
        }
 
310
        return 0;
 
311
}
 
312
 
 
313
 
 
314
ILenum ilImage::Format()
 
315
{
 
316
        if (this->Id) {
 
317
                this->Bind();
 
318
                return ilGetInteger(IL_IMAGE_FORMAT);
 
319
        }
 
320
        return 0;
 
321
}
 
322
 
 
323
ILenum ilImage::PaletteType()
 
324
{
 
325
        if (this->Id) {
 
326
                this->Bind();
 
327
                return ilGetInteger(IL_PALETTE_TYPE);
 
328
        }
 
329
        return 0;
 
330
}
 
331
 
 
332
Lenum ilImage::PaletteAlphaIndex()
 
333
{
 
334
        if (this->Id) {
 
335
                this->Bind();
 
336
                return ilGetInteger(IL_PNG_ALPHA_INDEX);
 
337
        }
 
338
        return 0;
 
339
}
 
340
 
 
341
 
 
342
ILenum ilImage::Type()
 
343
{
 
344
        if (this->Id) {
 
345
                this->Bind();
 
346
                return ilGetInteger(IL_IMAGE_TYPE);
 
347
        }
 
348
        return 0;
 
349
}
 
350
 
 
351
 
 
352
ILenum ilImage::NumImages()
 
353
{
 
354
        if (this->Id) {
 
355
                this->Bind();
 
356
                return ilGetInteger(IL_NUM_IMAGES);
 
357
        }
 
358
        return 0;
 
359
}
 
360
 
 
361
 
 
362
ILenum ilImage::NumMipmaps()
 
363
{
 
364
        if (this->Id) {
 
365
                this->Bind();
 
366
                return ilGetInteger(IL_NUM_MIPMAPS);
 
367
        }
 
368
        return 0;
 
369
}
 
370
 
 
371
 
 
372
ILuint ilImage::GetId() const
 
373
{
 
374
        return this->Id;
 
375
}
 
376
 
 
377
ILenum ilImage::GetOrigin(ILvoid)
 
378
{
 
379
    ILinfo Info;
 
380
 
 
381
        if (this->Id) {
 
382
                this->Bind();
 
383
        iluGetImageInfo(&Info);
 
384
                return Info.Origin;
 
385
        }
 
386
        return 0;
 
387
}
 
388
 
 
389
ILubyte* ilImage::GetData()
 
390
{
 
391
        if (this->Id) {
 
392
                this->Bind();
 
393
                return ilGetData();
 
394
        }
 
395
        return 0;
 
396
}
 
397
 
 
398
 
 
399
ILubyte* ilImage::GetPalette()
 
400
{
 
401
        if (this->Id) {
 
402
                this->Bind();
 
403
                return ilGetPalette();
 
404
        }
 
405
        return 0;
 
406
}
 
407
 
 
408
 
 
409
 
 
410
//
 
411
// Private members
 
412
//
 
413
 
 
414
ILvoid ilImage::iStartUp()
 
415
{
 
416
        ilInit();
 
417
        iluInit();
 
418
        ilutInit();
 
419
        return;
 
420
}
 
421
 
 
422
 
 
423
ILvoid ilImage::iGenBind()
 
424
{
 
425
        if (this->Id == 0) {
 
426
                ilGenImages(1, &this->Id);
 
427
        }
 
428
        ilBindImage(this->Id);
 
429
        return;
 
430
}
 
431
 
 
432
 
 
433
 
 
434
//
 
435
// Operators
 
436
//
 
437
 
 
438
ilImage& ilImage::operator = (ILuint Image)
 
439
{
 
440
        if (this->Id == 0)
 
441
                this->Id = Image;
 
442
        else {
 
443
                this->Bind();
 
444
                ilCopyImage(Image);
 
445
        }
 
446
 
 
447
        return *this;
 
448
}
 
449
 
 
450
 
 
451
ilImage& ilImage::operator = (const ilImage &Image)
 
452
{
 
453
        if (Id == 0)
 
454
                Id = Image.GetId();
 
455
        else {
 
456
                Bind();
 
457
                ilCopyImage(Image.GetId());
 
458
        }
 
459
 
 
460
        return *this;
 
461
}
 
462
 
 
463
 
 
464
 
 
465
//
 
466
//
 
467
// ILFILTERS
 
468
//
 
469
//
 
470
 
 
471
ILboolean ilFilters::Alienify(ilImage &Image)
 
472
{
 
473
        Image.Bind();
 
474
        return iluAlienify();
 
475
}
 
476
 
 
477
 
 
478
ILboolean ilFilters::BlurAvg(ilImage &Image, ILuint Iter)
 
479
{
 
480
        Image.Bind();
 
481
        return iluBlurAvg(Iter);
 
482
}
 
483
 
 
484
 
 
485
 
 
486
ILboolean ilFilters::BlurGaussian(ilImage &Image, ILuint Iter)
 
487
{
 
488
        Image.Bind();
 
489
        return iluBlurGaussian(Iter);
 
490
}
 
491
 
 
492
 
 
493
ILboolean ilFilters::Contrast(ilImage &Image, ILfloat Contrast)
 
494
{
 
495
        Image.Bind();
 
496
        return iluContrast(Contrast);
 
497
}
 
498
 
 
499
 
 
500
ILboolean ilFilters::EdgeDetectE(ilImage &Image)
 
501
{
 
502
        Image.Bind();
 
503
        return iluEdgeDetectP();
 
504
}
 
505
 
 
506
 
 
507
ILboolean ilFilters::EdgeDetectP(ilImage &Image)
 
508
{
 
509
        Image.Bind();
 
510
        return iluEdgeDetectP();
 
511
}
 
512
 
 
513
 
 
514
ILboolean ilFilters::EdgeDetectS(ilImage &Image)
 
515
{
 
516
        Image.Bind();
 
517
        return iluEdgeDetectS();
 
518
}
 
519
 
 
520
 
 
521
ILboolean ilFilters::Emboss(ilImage &Image)
 
522
{
 
523
        Image.Bind();
 
524
        return iluEmboss();
 
525
}
 
526
 
 
527
 
 
528
ILboolean ilFilters::Gamma(ilImage &Image, ILfloat Gamma)
 
529
{
 
530
        Image.Bind();
 
531
        return iluGammaCorrect(Gamma);
 
532
}
 
533
 
 
534
 
 
535
ILboolean ilFilters::Negative(ilImage &Image)
 
536
{
 
537
        Image.Bind();
 
538
        return iluNegative();
 
539
}
 
540
 
 
541
 
 
542
ILboolean ilFilters::Noisify(ilImage &Image, ILubyte Factor)
 
543
{
 
544
        Image.Bind();
 
545
        return iluNoisify(Factor);
 
546
}
 
547
 
 
548
 
 
549
ILboolean ilFilters::Pixelize(ilImage &Image, ILuint PixSize)
 
550
{
 
551
        Image.Bind();
 
552
        return iluPixelize(PixSize);
 
553
}
 
554
 
 
555
 
 
556
ILboolean ilFilters::Saturate(ilImage &Image, ILfloat Saturation)
 
557
{
 
558
        Image.Bind();
 
559
        return iluSaturate1f(Saturation);
 
560
}
 
561
 
 
562
 
 
563
ILboolean ilFilters::Saturate(ilImage &Image, ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation)
 
564
{
 
565
        Image.Bind();
 
566
        return iluSaturate4f(r, g, b, Saturation);
 
567
}
 
568
 
 
569
 
 
570
ILboolean ilFilters::ScaleColours(ilImage &Image, ILfloat r, ILfloat g, ILfloat b)
 
571
{
 
572
        Image.Bind();
 
573
        return iluScaleColours(r, g, b);
 
574
}
 
575
 
 
576
 
 
577
ILboolean ilFilters::Sharpen(ilImage &Image, ILfloat Factor, ILuint Iter)
 
578
{
 
579
        Image.Bind();
 
580
        return iluSharpen(Factor, Iter);
 
581
}
 
582
 
 
583
 
 
584
 
 
585
//
 
586
//
 
587
// ILOPENGL
 
588
//
 
589
//
 
590
 
 
591
#ifdef ILUT_USE_OPENGL
 
592
ILvoid ilOgl::Init()
 
593
{
 
594
        ilutRenderer(ILUT_OPENGL);
 
595
        return;
 
596
}
 
597
 
 
598
 
 
599
GLuint ilOgl::BindTex(ilImage &Image)
 
600
{
 
601
        Image.Bind();
 
602
        return ilutGLBindTexImage();
 
603
}
 
604
 
 
605
 
 
606
ILboolean ilOgl::Upload(ilImage &Image, ILuint Level)
 
607
{
 
608
        Image.Bind();
 
609
        return ilutGLTexImage(Level);
 
610
}
 
611
 
 
612
 
 
613
GLuint ilOgl::Mipmap(ilImage &Image)
 
614
{
 
615
        Image.Bind();
 
616
        return ilutGLBuildMipmaps();
 
617
}
 
618
 
 
619
 
 
620
ILboolean ilOgl::Screen()
 
621
{
 
622
        return ilutGLScreen();
 
623
}
 
624
 
 
625
 
 
626
ILboolean ilOgl::Screenie()
 
627
{
 
628
        return ilutGLScreenie();
 
629
}
 
630
#endif//ILUT_USE_OPENGL
 
631
 
 
632
 
 
633
 
 
634
//
 
635
//
 
636
// ILALLEGRO
 
637
//
 
638
//
 
639
 
 
640
#ifdef ILUT_USE_ALLEGRO
 
641
ILvoid ilAlleg::Init()
 
642
{
 
643
        ilutRenderer(IL_ALLEGRO);
 
644
        return;
 
645
}
 
646
 
 
647
 
 
648
BITMAP *ilAlleg::Convert(ilImage &Image, PALETTE Pal)
 
649
{
 
650
        Image.Bind();
 
651
        return ilutConvertToAlleg(Pal);
 
652
}
 
653
#endif//ILUT_USE_ALLEGRO
 
654
 
 
655
 
 
656
 
 
657
//
 
658
//
 
659
// ILWIN32
 
660
//
 
661
//
 
662
 
 
663
#ifdef ILUT_USE_WIN32
 
664
ILvoid ilWin32::Init()
 
665
{
 
666
        ilutRenderer(ILUT_WIN32);
 
667
        return;
 
668
}
 
669
 
 
670
 
 
671
HBITMAP ilWin32::Convert(ilImage &Image)
 
672
{
 
673
        Image.Bind();
 
674
        return ilutConvertToHBitmap(GetDC(NULL));
 
675
}
 
676
 
 
677
 
 
678
ILboolean ilWin32::GetClipboard(ilImage &Image)
 
679
{
 
680
        Image.Bind();
 
681
        return ilutGetWinClipboard();
 
682
}
 
683
 
 
684
 
 
685
ILvoid ilWin32::GetInfo(ilImage &Image, BITMAPINFO *Info)
 
686
{
 
687
        Image.Bind();
 
688
        ilutGetBmpInfo(Info);
 
689
        return;
 
690
}
 
691
 
 
692
 
 
693
ILubyte* ilWin32::GetPadData(ilImage &Image)
 
694
{
 
695
        Image.Bind();
 
696
        return ilutGetPaddedData();
 
697
}
 
698
 
 
699
 
 
700
HPALETTE ilWin32::GetPal(ilImage &Image)
 
701
{
 
702
        Image.Bind();
 
703
        return ilutGetHPal();
 
704
}
 
705
 
 
706
 
 
707
ILboolean ilWin32::GetResource(ilImage &Image, HINSTANCE hInst, ILint ID, char *ResourceType)
 
708
{
 
709
        Image.Bind();
 
710
        return ilutLoadResource(hInst, ID, ResourceType, IL_TYPE_UNKNOWN);
 
711
}
 
712
 
 
713
 
 
714
ILboolean ilWin32::GetResource(ilImage &Image, HINSTANCE hInst, ILint ID, char *ResourceType, ILenum Type)
 
715
{
 
716
        Image.Bind();
 
717
        return ilutLoadResource(hInst, ID, ResourceType, Type);
 
718
}
 
719
 
 
720
 
 
721
ILboolean ilWin32::SetClipboard(ilImage &Image)
 
722
{
 
723
        Image.Bind();
 
724
        return ilutSetWinClipboard();
 
725
}
 
726
#endif//ILUT_USE_WIN32
 
727
 
 
728
 
 
729
 
 
730
//
 
731
//
 
732
// ILVALIDATE
 
733
//
 
734
//
 
735
 
 
736
ILboolean ilValidate::Valid(ILenum Type, char *FileName)
 
737
{
 
738
        return ilIsValid(Type, FileName);
 
739
}
 
740
 
 
741
 
 
742
ILboolean ilValidate::Valid(ILenum Type, FILE *File)
 
743
{
 
744
        return ilIsValidF(Type, File);
 
745
}
 
746
 
 
747
 
 
748
ILboolean ilValidate::Valid(ILenum Type, ILvoid *Lump, ILuint Size)
 
749
{
 
750
        return ilIsValidL(Type, Lump, Size);
 
751
}
 
752
 
 
753
 
 
754
 
 
755
//
 
756
//
 
757
// ILSTATE
 
758
//
 
759
//
 
760
 
 
761
ILboolean ilState::Disable(ILenum State)
 
762
{
 
763
        return ilDisable(State);
 
764
}
 
765
 
 
766
 
 
767
ILboolean ilState::Enable(ILenum State)
 
768
{
 
769
        return ilEnable(State);
 
770
}
 
771
 
 
772
 
 
773
ILvoid ilState::Get(ILenum Mode, ILboolean &Param)
 
774
{
 
775
        ilGetBooleanv(Mode, &Param);
 
776
        return;
 
777
}
 
778
 
 
779
 
 
780
ILvoid ilState::Get(ILenum Mode, ILint &Param)
 
781
{
 
782
        ilGetIntegerv(Mode, &Param);
 
783
        return;
 
784
}
 
785
 
 
786
 
 
787
ILboolean ilState::GetBool(ILenum Mode)
 
788
{
 
789
        return ilGetBoolean(Mode);
 
790
}
 
791
 
 
792
 
 
793
ILint ilState::GetInt(ILenum Mode)
 
794
{
 
795
        return ilGetInteger(Mode);
 
796
}
 
797
 
 
798
 
 
799
const char *ilState::GetString(ILenum StringName)
 
800
{
 
801
        return ilGetString(StringName);
 
802
}
 
803
 
 
804
 
 
805
ILboolean ilState::IsDisabled(ILenum Mode)
 
806
{
 
807
        return ilIsDisabled(Mode);
 
808
}
 
809
 
 
810
 
 
811
ILboolean ilState::IsEnabled(ILenum Mode)
 
812
{
 
813
        return ilIsEnabled(Mode);
 
814
}
 
815
 
 
816
 
 
817
ILboolean ilState::Origin(ILenum Mode)
 
818
{
 
819
        return ilOriginFunc(Mode);
 
820
}
 
821
 
 
822
 
 
823
ILvoid ilState::Pop()
 
824
{
 
825
        ilPopAttrib();
 
826
        return;
 
827
}
 
828
 
 
829
 
 
830
ILvoid ilState::Push(ILuint Bits = IL_ALL_ATTRIB_BITS)
 
831
{
 
832
        ilPushAttrib(Bits);
 
833
        return;
 
834
}
 
835
 
 
836
 
 
837
 
 
838
 
 
839
 
 
840
//
 
841
//
 
842
// ILERROR
 
843
//
 
844
//
 
845
 
 
846
ILvoid ilError::Check(ILvoid (*Callback)(const char*))
 
847
{
 
848
        static ILenum Error;
 
849
 
 
850
        while ((Error = ilGetError()) != IL_NO_ERROR) {
 
851
                Callback(iluErrorString(Error));
 
852
        }
 
853
 
 
854
        return;
 
855
}
 
856
 
 
857
 
 
858
ILvoid ilError::Check(ILvoid (*Callback)(ILenum))
 
859
{
 
860
        static ILenum Error;
 
861
 
 
862
        while ((Error = ilGetError()) != IL_NO_ERROR) {
 
863
                Callback(Error);
 
864
        }
 
865
 
 
866
        return;
 
867
}
 
868
 
 
869
 
 
870
ILenum ilError::Get()
 
871
{
 
872
        return ilGetError();
 
873
}
 
874
 
 
875
 
 
876
const char *ilError::String()
 
877
{
 
878
        return iluErrorString(ilGetError());
 
879
}
 
880
 
 
881
 
 
882
const char *ilError::String(ILenum Error)
 
883
{
 
884
        return iluErrorString(Error);
 
885
}