nngxInitialize Function

Syntax

NNGX_APICALL GLboolean NNGX_APIENTRY nngxInitialize(
     GLvoid *(*)(GLenum, GLenum, GLuint, GLsizei) allocator,
     void(*)(GLenum, GLenum, GLuint, GLvoid *) deallocator
);

Parameters

Name Description
in allocator Pointer to an allocator function
in deallocator Pointer to a deallocator function

Return Values

Returns GL_TRUE if initialization succeeded and GL_FALSE if it failed.

Description

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.

orderAreaUsageRequested size (bytes)Note
1Main memory (FCRAM)SYSTEM12252For internal state management. Deallocated by a call to the nngxFinalize function.
2Main memory (FCRAM)SYSTEM40For internal state management. Deallocated by a call to the nngxFinalize function.
3Main memory (FCRAM)SYSTEM632For internal state management. Deallocated by a call to the nngxFinalize function.
4Main memory (FCRAM)SYSTEM120For internal state management. Deallocated by a call to the nngxFinalize function.
5Main memory (FCRAM)SYSTEM460For internal state management. Deallocated by a call to the nngxFinalize function.
6Main memory (FCRAM)SYSTEM156For internal state management. Deallocated by a call to the nngxFinalize function.
7Main memory (FCRAM)SYSTEM60For register initialization command.This is deallocated inside the function.
8Main memory (FCRAM)COMMANDBUFFER65984For register initialization command.This is deallocated inside the function.
9Main memory (FCRAM)SYSTEM16384Buffer for temporary use.This is deallocated inside the function.

See Also

nngxFinalize

Revision History

2011/10/04
Added See Also section.
2011/08/02
Added information about internally created threads and events.
2011/04/01
Added description of buffers requested from the allocator inside the nngxInitialize function.
2010/02/01
Made revisions due to changes in the attribute specifications.
2010/01/07
Initial version.

CONFIDENTIAL