# NNS_GfdAllocLnkTexVram

## C Specification

      #include <nnsys/gfd.h>

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

## Arguments

szByte | The size of the region to allocate (16 to 524272 bytes)
is4x4comp | TRUE should be set if the texture type is a 4x4 compressed texture
opt | Option This is not used

## Return Values

Returns a texture key that shows the allocated VRAM region.

## Description

Allocates the texture memory in VRAM according to the size specified in `szByte` and returns a texture key that represents the VRAM region. If the allocation fails, it returns `NNS_GFD_ALLOC_ERROR_TEXKEY`, which indicates an error.
If `is4x4comp` is TRUE, texture memory is allocated for a 4x4 texel compressed texture. (The region for the index palette is allocated at the same time.)

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_GfdFreeLnkTexVram`

## Revision History

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

10/12/2004 Initial version.