main.nim 616 B

123456789101112131415161718192021222324
  1. import
  2. tri_engine/config,
  3. tri_engine/math/vec,
  4. tri_engine/math/circle,
  5. tri_engine/gfx/gl/primitive,
  6. tri_engine/gfx/tex,
  7. tri_engine/gfx/color,
  8. tri_engine/tri_engine,
  9. gui
  10. var isRunning = true
  11. block:
  12. var renderer = newRenderer(w=10, h=10)
  13. var primitive = newPrimitiveCircle(0.3.TR, color=white(0.5, 0.8), z=15)
  14. renderer.addPrimitive(primitive)
  15. var verts = newVert((min: newV2xy(-0.4), size: newV2xy(0.3)))
  16. var primitive2 = newPrimitive(verts, color=red(0.5, 0.8), z=10)
  17. renderer.addPrimitive(primitive2)
  18. var mainMenuWidget = newWidget(wtImg, wlBg, rect=(newV2xy(-1.0), newV2xy(2.0)))