@@ -25,7 +25,7 @@ You can download the executables for Windows and Linux in the [release section](
2525- [x] Structs (on the heap)
2626- [x] C-calls (FFI) to dynamic libraries
2727- [x] Strings
28- - [ ] Printing
28+ - [x ] Printing
2929- [ ] Arrays
3030- [ ] Closures
3131
@@ -113,11 +113,40 @@ ret l.begin.x + l.end.y;
113113
114114```
115115# Strings
116- let print = extern test::print(s: Str ): Void;
116+ let print = extern test::print(s: String ): Void;
117117let str = "Hello, World!";
118118print(str);
119119```
120120
121+ ```
122+ # Using external library (raylib)
123+ let str = "Hello, World!";
124+
125+ let InitWindow = extern raylib::InitWindow(w: Int, h: Int, s: String): Void;
126+ InitWindow(800, 600, str);
127+
128+ let SetTargetFPS = extern raylib::SetTargetFPS(fps: Int): Void;
129+ SetTargetFPS(60);
130+
131+ let WindowShouldClose = extern raylib::WindowShouldClose(): Bool;
132+ let CloseWindow = extern raylib::CloseWindow(): Void;
133+
134+ let BeginDrawing = extern raylib::BeginDrawing(): Void;
135+ let ClearBackground = extern raylib::ClearBackground(color: Int): Void;
136+ let EndDrawing = extern raylib::EndDrawing(): Void;
137+
138+ let DrawText = extern raylib::DrawText(text: String, x: Int, y: Int, fontSize: Int, color: Int): Void;
139+
140+ while(WindowShouldClose() == false) {
141+ BeginDrawing();
142+ ClearBackground(1);
143+ DrawText(str, 190, 200, 20, 1);
144+ EndDrawing();
145+ }
146+
147+ CloseWindow();
148+ ```
149+
121150## Error reporting
122151
123152Following you find an example on how parsing errors are reported to the user
0 commit comments