Same as above but allows specification of Format and Type
| 87 | |
| 88 | // Same as above but allows specification of Format and Type |
| 89 | ILAPI ILimage* ILAPIENTRY ilNewImageFull(ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, void *Data) |
| 90 | { |
| 91 | ILimage *Image; |
| 92 | |
| 93 | if (Bpp == 0 || Bpp > 4) { |
| 94 | return NULL; |
| 95 | } |
| 96 | |
| 97 | Image = (ILimage*)ialloc(sizeof(ILimage)); |
| 98 | if (Image == NULL) { |
| 99 | return NULL; |
| 100 | } |
| 101 | |
| 102 | if (!ilInitImage(Image, Width, Height, Depth, Bpp, Format, Type, Data)) { |
| 103 | if (Image->Data != NULL) { |
| 104 | ifree(Image->Data); |
| 105 | } |
| 106 | ifree(Image); |
| 107 | return NULL; |
| 108 | } |
| 109 | |
| 110 | return Image; |
| 111 | } |
| 112 | |
| 113 | |
| 114 | //! Changes the current bound image to use these new dimensions (current data is destroyed). |
nothing calls this directly
no test coverage detected