2025-08-27 07:31 PM
While evaluating the examples in API Kit I run into the following issue. I'm getting access violation exception when DrawPrimitives called
GSErrCode ret = ACAPI_DrawOrder_DrawOrderInit();
if (ret != NoError)
return;
API_Element elem;
while ((ret = ACAPI_DrawOrder_DrawOrderGetNext((Int32)(APIFilt_OnVisLayer | APIFilt_OnActFloor), &elem.header)) == NoError) {
if (elem.header.type != API_WallID)
continue;
ret = ACAPI_DrawingPrimitive_ShapePrims(elem.header, DrawPrimitives);
}
ACAPI_DrawOrder_DrawOrderTerm();Draw primitive contains only the following code
static GSErrCode DrawPrimitives(const API_PrimElement* primElem,
const void* par1,
const void* par2,
const void* par3)
{
DBPrintf("Draw Primitives type %s", primElem->header.typeID);
return NoError;
}The logic is called while the story window is active. I'm currently running in the DEMO mode. Could it be the reason for the exception? Or am I doing something else wrong?
Any help is highly appreciated.
2025-09-09 03:30 AM
Hi, I purpose the problem was the type conversion:
DBPrintf("Draw Primitives type %s", primElem->header.typeID);
Could you try to change %s to %d to see whether the error still happen?
DBPrintf("Draw Primitives type %d", primElem->header.typeID);
HTH.