nngxInitialize Function
NNGX_APICALL GLboolean NNGX_APIENTRY nngxInitialize(
GLvoid *(*)(GLenum, GLenum, GLuint, GLsizei) allocator,
void(*)(GLenum, GLenum, GLuint, GLvoid *) deallocator
);
| Name | Description | |
|---|---|---|
| in | allocator | Pointer to an allocator function |
| in | deallocator | Pointer to a deallocator function |
GL_TRUE if initialization succeeded and GL_FALSE if it failed. Initializes the graphics library (DMPGL).
Set allocator to the function that DMPGL will use to allocate memory regions. The allocator's first argument specifies the memory region and takes a value of NN_GX_MEM_FCRAM, NN_GX_MEM_VRAMA, or NN_GX_MEM_VRAMB. The allocator's second argument specifies how memory will be used and takes a value of NN_GX_MEM_SYSTEM, NN_GX_MEM_TEXTURE, NN_GX_MEM_VERTEXBUFFER, NN_GX_MEM_RENDERBUFFER, NN_GX_MEM_DISPLAYBUFFER, or NN_GX_MEM_COMMANDBUFFER. The allocator's third argument is the object name. The allocator's fourth argument is the number of bytes of memory to allocate. Implement the allocator so that it returns 0 when it fails and the memory address of the allocated region when it succeeds.
Set deallocator to the function that DMPGL uses to free memory regions. The deallocator's first, second, and third arguments are the same as the allocator's. The deallocator's fourth argument is the memory address to free.
Once this function has successfully initialized the library, it returns GL_FALSE if it is called again before the nngxFinalize function is called.
Between the point this function is called and the nngxFinalize function is called, one thread for internal processing is generated and one nn::os::Event object is allocated.
This function allocates a command buffer to initialize the GPU register, and a buffer for internal state management (passes requests to the allocator). This function includes a buffer used for temporary allocation only, and a buffer that is kept until the nngxFinalize function is called. The breakdown is as follows.
| order | Area | Usage | Requested size (bytes) | Note |
|---|---|---|---|---|
| 1 | Main memory (FCRAM) | SYSTEM | 12252 | For internal state management. Deallocated by a call to the nngxFinalize function. |
| 2 | Main memory (FCRAM) | SYSTEM | 40 | For internal state management. Deallocated by a call to the nngxFinalize function. |
| 3 | Main memory (FCRAM) | SYSTEM | 632 | For internal state management. Deallocated by a call to the nngxFinalize function. |
| 4 | Main memory (FCRAM) | SYSTEM | 120 | For internal state management. Deallocated by a call to the nngxFinalize function. |
| 5 | Main memory (FCRAM) | SYSTEM | 460 | For internal state management. Deallocated by a call to the nngxFinalize function. |
| 6 | Main memory (FCRAM) | SYSTEM | 156 | For internal state management. Deallocated by a call to the nngxFinalize function. |
| 7 | Main memory (FCRAM) | SYSTEM | 60 | For register initialization command.This is deallocated inside the function. |
| 8 | Main memory (FCRAM) | COMMANDBUFFER | 65984 | For register initialization command.This is deallocated inside the function. |
| 9 | Main memory (FCRAM) | SYSTEM | 16384 | Buffer for temporary use.This is deallocated inside the function. |
nngxInitialize function.CONFIDENTIAL