' ****************************************************************************************
function ddClipperPrototype() as hresult
  #ifdef DebugFatal
    messagebox(null,"iDirectDraw.Clipper::#" & DDCLIPPERPROTOID & " Function not implemented", _
    "DirectX",MB_SYSTEMMODAL or MB_ICONERROR)
  #endif      
  return DDERR_UNSUPPORTED
  
  
  asm
    .balign 32
    _ddClipperProtoTable_:  
    #macro ProtoNum(X)
    mov dword ptr [DDCLIPPERPROTOID],X
    jmp ddClipperPrototype
    .balign 32
    #endmacro
    ProtoNum(0)
    ProtoNum(1)
    ProtoNum(2)
    ProtoNum(3)
    ProtoNum(4)
    ProtoNum(5)
    ProtoNum(6)
    ProtoNum(7)
    ProtoNum(8)
  end asm  
  
end function
' ****************************************************************************************
UndefAll()
#define P1 DDCLIPPER as ddClipperObject ptr
function ddClipper_2_Release(P1) as hresult
  #ifdef MyDebugX
  Cout("IDirectDraw::Clipper.Release (2)" + chr$(13,10) + _
  " >> DDCLIPPER: "+hex$(cast(uinteger,DDCLIPPER),8))
  #endif
  Delete DDCLIPPER  
  return DD_OK
end function
' ****************************************************************************************
UndefAll()
#define P1 DDCLIPPER as ddClipperObject ptr
#define P2 dwFlags as dword
#define P3 HWnd as hwnd
function ddClipper_8_SetHWnd(P1,P2,P3) as hresult
  #ifdef MyDebugX
  Cout("IDirectDraw::Clipper.SetHWnd (8)" + chr$(13,10) + _
  " >> DDCLIPPER: "+hex$(cast(uinteger,DDCLIPPER),8) + _
  " hwnd: "+hex$(cast(integer,hwnd),8))
  #endif  
  with *DDCLIPPER
    .hwnd = hwnd
  end with
  return DD_OK
end function
' ****************************************************************************************
' ****************************************************************************************
sub ClipperFuncs(VTABLE() as any ptr)
  dim as any ptr PROTOTABLE
  asm mov dword ptr [PROTOTABLE], offset _ddClipperProtoTable_
  for CNT as integer = 0 to 8
    VTABLE(CNT) = PROTOTABLE+CNT*32
  next CNT  
  VTABLE(2) = @ddClipper_2_Release  
  VTABLE(8) = @ddClipper_8_SetHWnd
end sub
