Initialize manually the OKF Font Engine alpha blending look up table.
int OkfInitializeAlphaLUT( OKFALPHALEVELS alphaLevels, unsigned char (*pAlphaLUT)[32][32] );
Routine | Required Header |
OkfInitializeAlphaLUT | "okf.h" |
Libraries
OKLIB.A | Oankali's GP32 run-time library |
Return Value
In case of success OkfInitializeAlphaLUT returns 0, otherwise it returns -1. Look at okf.lastError for details on what happened.
Parameters
alphaLevels
A named constant of the enumerated type OKFALPHALEVELS indicating the precision of the new alpha LUT.
pAlphaLUT
A pointer to an external alpha LUT to be used by the OKF Font Engine. If pAlphaLUT is NULL, a new alpha LUT will be created.
Remarks
The OkfInitializeAlphaLUT function destroys the current alpha LUT provided it was created by the OKF Font Engine. It then tries to register the alpha LUT pointed by pAlphaLUT if it is not NULL. If pAlphaLUT is NULL, the function allocates memory for a new alpha LUT of alphaLevels precision and then initializes it with new values.
If there is not enough memory, an error occurs. In this case, the OKF Font Engine is left without alpha LUT. You must create a smaller one, but never leave the OKF Font Engine without alpha LUT if you don't want to get run-time errors when using the blending capacities of the rendering functions.
To avoid fragmentation of the memory, the best place to call OkfInitializeAlphaLUT is just after the call of OkfInitialize. Or, at least, before any other dynamic memory allocation.
See Also
OKF Font Engine Routines, OKF Font Engine Constants, OkfInitialize