sfml.nim 963 B

123456789101112131415161718192021222324252627
  1. {.passL: "-lsfml-graphics -lsfml-system -lsfml-window".}
  2. type
  3. VideoMode* {.importcpp: "sf::VideoMode".} = object
  4. RenderWindowObj {.importcpp: "sf::RenderWindow".} = object
  5. RenderWindow* = ptr RenderWindowObj
  6. Color* {.importcpp: "sf::Color".} = object
  7. Event* {.importcpp: "sf::Event".} = object
  8. {.push cdecl, header: "<SFML/Graphics.hpp>".}
  9. proc videoMode*(modeWidth, modeHeight: cuint, modeBitsPerPixel: cuint = 32): VideoMode
  10. {.importcpp: "sf::VideoMode(@)", constructor.}
  11. proc newRenderWindow*(mode: VideoMode, title: cstring): RenderWindow
  12. {.importcpp: "new sf::RenderWindow(@)", constructor.}
  13. proc pollEvent*(window: RenderWindow, event: var Event): bool
  14. {.importcpp: "#.pollEvent(@)".}
  15. proc newColor*(red, green, blue, alpha: uint8): Color
  16. {.importcpp: "sf::Color(@)", constructor.}
  17. proc clear*(window: RenderWindow, color: Color) {.importcpp: "#.clear(@)".}
  18. proc display*(window: RenderWindow) {.importcpp: "#.display()".}