PEXCreateMipmapTM - Create Mipmap Color Texture Map (5.2)


Synopsis

   PEXTextureMap PEXCreateMipmapTM(
           Display *display,
           int dimensionality,
           int texel_type,
           int num_levels,
           PEXMipmapLevel *levels
      )

Arguments

display
A pointer to a display structure returned by a successful XOpenDisplay call.

dimensionality
The dimension of the texture map (PEXTMDimension1D, PEXTMDimension2D or PEXTMDimension3D).

texel_type
The type of texel data in the mipmap (PEXTexelTypeLum, PEXTexelTypeLum8, PEXTexelTypeLum16, PEXTexelTypeLumA, PEXTexelTypeLumA8, PEXTexelTypeLumA16, PEXTexelTypeRGB, PEXTexelTypeRGB8, PEXTexelTypeRGB16, PEXTexelTypeRGBA, PEXTexelTypeRGBA8 or PEXTexelTypeRGBA16).

num_levels
The number of levels in the mipmap.

levels
A pointer a list of PEXMipmapLevel structures each representing a level of the color mipmap.

Returns

The resource ID for a PEX Texture Map.

Description

Invoke PEXCreateMipmapTM to create a mipmap texture resource that you can reference from a texture mapping LUT.

The dimensionality argument indicates the dimension of the texture map being created. Levels provides the actual texel data. Texel_type indicates the type of texel data as well as the components of the newly created texture resource.

The num_levels of mipmap levels in the levels argument are ordered to define the texture map, starting with the base level. Each member includes the dimension in each direction of that level of the texture map. The texels are assumed to be stored in t0-t1-t2 order, with t0 varying fastest and t2 varying slowest. The texture coordinates are normalized, so the first through last texel correspond to the texel coordinate range 0.0 to 1.0.

Inquire MaxFastTMSize with the function PEXGetImpDepConstants to determine whether there is a maximum size in any dimension on the base level which must be respected to achieve optimized implementation. If PEX has such a limit, then it treats larger texture maps in an implementation-dependent way. PEX implementations may have other restrictions on the dimensions of each level of the texture map. Inquire PowerOfTwoTMRequired with PEXGetImpDepConstants to determine if each dimension must be a power of two. Inquire SquareTMRequired with the same request to determine if all the dimensions on each level must be equal to one another.

Errors

BadAlloc
The implementation failed to allocate a texture map resource.

BadValue
The specified texture map dimension is not valid.

BadValue
The specified texture map texel type is not valid.

BadValue
The specified number of texel arrays does not match the number of texel arrays expected.

BadValue
The texture map size is required to be a power of two.

BadValue
The texture map size is required to be square.

BadValue
Texel component is out of range.

See Also

For a list of related topics and for a list of all texture mapping functions, see Texture Mapping.