example_02.bmx 520 B

123456789101112131415161718192021222324252627282930313233
  1. SuperStrict
  2. Framework SDL.SDLRenderMax2D
  3. 'Framework brl.glmax2d
  4. import brl.polygon
  5. Import BRL.StandardIO
  6. Local poly:Float[] = [100, 100, 200, 100, 200, 200, 100, 200]
  7. Local indices:Int[] = TriangulatePoly(poly)
  8. Print "count = " + indices.length
  9. For Local i:Int = 0 Until indices.length
  10. Print indices[i]
  11. next
  12. Graphics 800, 600, 0
  13. SetHandle( 150, 150 )
  14. SetOrigin( 200, 200 )
  15. Local angle:Float = 0
  16. While Not keydown(KEY_ESCAPE)
  17. Cls
  18. DrawPoly(poly, indices)
  19. SetRotation( angle )
  20. angle :+ 0.5
  21. Flip
  22. Wend