A3DGlobalInsertGraphStyle

A3DStatus A3DGlobalInsertGraphStyle(const A3DGraphStyleData *pData, A3DUns32 *puiIndexStyle)
A3DStatus A3DGlobalInsertGraphStyle(const A3DGraphStyleData* pData, A3DUns32* puiIndexStyle)

Creates a new graphics style, returning its index.

2.0

When given an``A3DGraphStyleData``, the function searches for an already existing color code of the same value and returns its index. If the color does not exist, it is created and a new index is returned.

In case of success,``puiIndexRgbColor``is set to the index of the color. This index can be compared to``A3D_DEFAULT_COLOR_INDEX``to check whether the input color code matches the default color. In case of failure``*puiIndexRgbColor``is unchanged.

A3DGraphRgbColorDatargb=A3D_MAKE_DATA(A3DGraphRgbColorData);
rgb.m_dRed=rgb.m_dGreen=rgb.m_dBlue=0.75f;
A3DUns32idx_0=A3D_DEFAULT_COLOR_INDEX;

A3DStatusresult=A3DGlobalInsertGraphRgbColor(&rgb,&idx_0);
assert(result==A3D_SUCCESS);

Secondinsertionwiththesamecolor,expectindextobethesame.
A3DUns32idx_1=A3D_DEFAULT_COLOR_INDEX;
result=A3DGlobalInsertGraphRgbColor(&rgb,&idx_1);
assert(result==A3D_SUCCESS);
assert(idx_0==idx_1);

Parameters

pData: The color code to insert.

puiIndexStyle: The resulting index for the style.

Returns

A3D_SUCCESS or an error code.