예제 #1
0
파일: shPaint.c 프로젝트: Chazzz/pyShiva
VG_API_CALL void vgDestroyPaint(VGPaint paint)
{
  SHint index;
  VG_GETCONTEXT(VG_NO_RETVAL);
  
  /* Check if handle valid */
  index = shPaintArrayFind(&context->paints, (SHPaint*)paint);
  VG_RETURN_ERR_IF(index == -1, VG_BAD_HANDLE_ERROR, VG_NO_RETVAL);
  
  /* Delete object and remove resource */
  SH_DELETEOBJ(SHPaint, (SHPaint*)paint);
  shPaintArrayRemoveAt(&context->paints, index);
  
  VG_RETURN(VG_NO_RETVAL);
}
SHint shIsValidPaint(VGContext *c, VGHandle h)
{
    int index = shPaintArrayFind(&c->paints, (SHPaint*)h);
    return (index == -1) ? 0 : 1;
}