minimal.odin 488 B

123456789101112131415161718192021222324252627
  1. package karl2d_minimal_example
  2. import k2 "../.."
  3. import "core:log"
  4. main :: proc() {
  5. context.logger = log.create_console_logger()
  6. k2.init(1080, 1080, "Karl2D Minimal Program")
  7. k2.set_window_position(300, 100)
  8. for !k2.shutdown_wanted() {
  9. k2.process_events()
  10. k2.clear(k2.BLUE)
  11. txt := "Hellöpe!"
  12. if k2.key_is_held(.K) {
  13. txt = "Holding K keyboard key"
  14. }
  15. k2.draw_text(txt, {10, 10}, 64, k2.WHITE)
  16. k2.present()
  17. free_all(context.temp_allocator)
  18. }
  19. k2.shutdown()
  20. }