#include once "fltk-c.bi"

'test of:
' DrawSetRGBColor
' DrawLine2
' DrawLoop2
' DrawPolygon2

sub DrawCB cdecl (self as any ptr)
  static as integer rot=0
  dim as integer w =Fl_WidgetGetW(self),xm=w\2
  dim as integer h =Fl_WidgetGetH(self),ym=h\2
  DrawSetRGBColor 255,0,0
  DrawLine2(10,10, 20,10, 20,20)
  
  DrawSetRGBColor 0,255,0
  DrawLoop2(30,10, 40,10, 40,20, 30,20)
  
  DrawSetRGBColor 0,0,255
  DrawPolygon2(50,10, 60,10, 60,20, 50,20)
  
  DrawSetRGBColor 0,128,128
  DrawBeginLine()
  DrawCurve(50,10, 60,0, 70,20, 80,10)
  DrawEndPoints()
  
end sub

dim as Fl_Window ptr win = Fl_WindowNew(100,100,640,480,"drawing03")
dim as Fl_BoxEx  ptr box = Fl_BoxExNew(5,5,630,470)
Fl_BoxExSetDrawCB box,@DrawCB
Fl_GroupSetResizable win,box
Fl_WindowShow win
Fl_Run
