Skip to content

Commit c0e1b77

Browse files
committed
Update README
1 parent 7b574ff commit c0e1b77

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

README.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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;
117117
let str = "Hello, World!";
118118
print(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

123152
Following you find an example on how parsing errors are reported to the user

TODO.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Roadmap
22

3-
- Strings
43
- terminal IO
54
- file IO
65
- Floats
@@ -9,6 +8,7 @@
98
synatx sugar for get, set with []
109
(for arrays, strings, maps)
1110
- Arrays
11+
- Dynamic Strings
1212
- Garbage collection for heap objects (structs)
1313
- Fix recursion example. Get return type of non recursive
1414
return and use as override. Ignore recursive return.

mfiles/raylib.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
let str = "Hello, World!";
32

43
let InitWindow = extern raylib::InitWindow(w: Int, h: Int, s: String): Void;

0 commit comments

Comments
 (0)