addhook.bmx 441 B

1234567891011121314151617181920212223242526272829
  1. SuperStrict
  2. 'This function will be automagically called every Flip
  3. Function MyHook:Object( id:Int,data:Object,context:Object )
  4. Global count:Int
  5. count:+1
  6. If count Mod 10=0 Then
  7. Print "Flips="+count
  8. End If
  9. End Function
  10. 'Add our hook to the system
  11. AddHook FlipHook,MyHook
  12. 'Some simple graphics
  13. Graphics 640,480,0
  14. While Not KeyHit( KEY_ESCAPE )
  15. Cls
  16. DrawText MouseX()+","+MouseY(),0,0
  17. Flip
  18. Wend