DevIL Documentation Home | Previous | Next

ilTexImage

The ilTexImage function changes the current bound image to use new dimensions.


ILboolean ilTexImage(
  ILuint Width,
  ILuint Height,
  ILuint Depth,
  ILubyte Bpp,
  ILenum Format,
  ILenum Type,
  ILvoid *Data
);

Parameters

Width
Specifies the new image width. This cannot be 0.

Height
Specifies the new image height. This cannot be 0.

Depth
Specifies the new image depth. Anything greater than 1 will make the image 3d. This cannot be 0.

Bpp
Specifies the new bytes per pixel (not bits per pixel). Common values are 3 and 4.

Format
Specifies the data format this image has. For a list of values this can be, see the See Also section.

Type
Specifies the data format this image has. For a list of values this can be, see the See Also section.

Data
Specifies data that should be copied to the new image. If this parameter is NULL, no data is copied, and the new image data consists of undefined values.

Remarks

Any current image data is destroyed by ilTexImage and replaced by a new image with the attributes specified. The new image data has undefined values. To set the new image data to a certain value, use ilClearImage or ilClearImageTo.

Error Codes

IL_ILLEGAL_OPERATION - There is currently no image bound. Use ilGenImages and ilBindImage before calling this function.
IL_INVALID_PARAM - One of the parameters provided was invalid. Width, Height, Depth or Bpp was an incorrect 0.
IL_OUT_OF_MEMORY - Could not allocate memory for the new image data.

See Also

ilGenImages, ilBindImage