# NNS_GfdAllocFrmTexVram

## C Specification

      #include <nnsys/gfd.h>

      NNSGfdTexKey NNS_GfdAllocFrmTexVram(u32 szByte, BOOL is4x4comp, u32 opt);

## Arguments

szByte | The size of texture-use memory you want to allocate (16 to 524272 bytes)
is4x4comp | TRUE if 4x4 texel compressed texture data is being allocated
opt | VRAM Memory Manager options (not used)

## Return Values

The key data showing the texture-use memory.

## Description

This function allocates texture-use memory of the size specified by `szByte` from VRAM, and returns the key showing the texture-use memory. If an error occurs when the texture-use memory is being allocated, the function returns `NNS_GFD_ALLOC_ERROR_TEXKEY`, which is a key indicating that an error has occurred. The opt parameter is not used with `NNS_GfdAllocFrmTexVram`.

If `TRUE` is specified in the `is4x4comp` argument, then texture-use memory is allocated for a 4x4 texel compressed texture. In this case, a region is allocated for the palette index in addition to a region for the texture image. The `NNS_GfdAllocFrmTexVram()` function succeeds only if both a texture image region and a palette index region can be allocated.

If an allocation request is made for a size below the minimum that can be expressed for the key, the request size is rounded up to the minimum. If an allocation request is made for a size above the maximum that can be expressed for the key, the allocation process will not be performed and an error key will be returned.

## See Also

NNS_GfdInitFrmTexVramManager, NNS_GfdFreeFrmTexVram

## Revision History

01/31/2005 Added a cautionary statement regarding the size range.

07/16/2004 Initial version.