mav_paletteTextureSet - Define a texture entry in a palette.

[ Maverik Level 1 functions ]

#

mav_paletteTextureSet

## Summary

Define a texture entry in a palette.

## Syntax

int mav_paletteTextureSet(MAV_palette *p, int index, char *filename);

- MAV_palette *p
  Palette to set.

- int index
  Index of texture to define, in range 0..`mav_opt_maxTextures` (default 150);

- char *filename
  The name of the file containing the texture.

## Description

This function defines texture entry `index` of palette `p` from file `filename`. Maverik itself only supports the PPM (raw or ASCII encodings) file format for textures. However, Maverik can use the ImageMagick `convert` program, if installed, to convert almost any other image file format into PPM and then parse that. This conversion process is hidden from the user so that Maverik appears to support virtually all image file formats. Furthermore, Maverik uses ImageMagick's `convert` program to resize the image, if needed, so that it is an integer power of 2 in both width and height -- a requirement placed on texture images by OpenGL.

The function returns `MAV_TRUE` if the texture was successfully read and `MAV_FALSE` if the operation failed.

## See also

mav_paletteColourSet.html>mav_paletteColourSet, mav_paletteMaterialSet.html>mav_paletteMaterialSet

Back to the index page.