├── .gitattributes
├── screenshot.gif
├── docs
├── game2048.wasm
├── index.html
└── game2048.js
├── config.nelua
├── README.md
├── game2048.nelua
└── raylib.nelua
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.nelua text eol=lf linguist-language=lua
2 |
--------------------------------------------------------------------------------
/screenshot.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/edubart/nelua-game2048/HEAD/screenshot.gif
--------------------------------------------------------------------------------
/docs/game2048.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/edubart/nelua-game2048/HEAD/docs/game2048.wasm
--------------------------------------------------------------------------------
/config.nelua:
--------------------------------------------------------------------------------
1 | ##[[
2 | local compiler = require 'nelua.ccompiler'
3 | if compiler.get_cc_info().is_emscripten then
4 | PLATFORM_WEB = true
5 | primtypes.integer = primtypes.int32
6 | primtypes.uinteger = primtypes.uint32
7 | primtypes.number = primtypes.float32
8 | cflags '-Oz -fno-plt -flto'
9 | cflags '-DGRAPHICS_API_OPENGL_ES2'
10 | cflags '-s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 -s TOTAL_MEMORY=16777216'
11 | cflags '-I/home/bart/apps/raylib/src /home/bart/apps/raylib/build.web/src/libraylib.bc'
12 | else
13 | linklib 'raylib'
14 | end
15 | ]]
16 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 2048 Game Clone in Nelua
2 |
3 | 
4 |
5 | Play in your browser at https://edubart.github.io/nelua-game2048/
6 |
7 | This an experimental clone of the [2048 game](https://play2048.co/) using
8 | [Nelua](https://github.com/edubart/nelua-lang) and
9 | [Raylib](https://www.raylib.com/). Made mainly for checking out raylib in practice.
10 |
11 | Raylib bindings from [raylib-nelua](https://github.com/Andre-LA/raylib-nelua-mirror) are used,
12 | thanks to @Andre-LA.
13 |
14 | ## Running
15 |
16 | You must have both Nelua and latest Raylib installed and working.
17 |
18 | To run simple do `nelua game2048.nelua`
19 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Nelua Game 2048
7 |
108 |
109 |
110 |
111 |
112 | Downloading...
113 |
114 | Resize canvas
115 | Lock/hide mouse pointer
116 |
118 |
119 |
120 |
121 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 | Developed in
132 | Nelua
133 | programming language using
134 | Raylib game library.
135 |
136 |
137 | Check out the game sources at GitHub repository.
138 |
139 |
140 |
141 |
218 |
219 |
220 |
221 |
222 |
223 |
--------------------------------------------------------------------------------
/game2048.nelua:
--------------------------------------------------------------------------------
1 | require 'config'
2 | require 'raylib'
3 | require 'math'
4 | require 'string'
5 | require 'vector'
6 |
7 | -- Compile time constants
8 | local SCREEN_WIDTH = 600
9 | local SCREEN_HEIGH = 800
10 | local TILEMAP_WIDTH = 512
11 | local TILEMAP_OFFSET: Vector2 = {
12 | (SCREEN_WIDTH - TILEMAP_WIDTH) // 2,
13 | SCREEN_HEIGH - TILEMAP_WIDTH - (SCREEN_WIDTH - TILEMAP_WIDTH) // 2
14 | }
15 | local TILE_SPACING = 12
16 | local TILE_COUNT = 4
17 | local TILE_WIDTH = (TILEMAP_WIDTH - (TILE_COUNT+1)*TILE_SPACING) // TILE_COUNT
18 | local NEWBUTTON_RECT: Rectangle = {SCREEN_WIDTH - 128 - 44, 48 + 128, 128, 48}
19 |
20 | -- Timer
21 | local frametime = GetTime()
22 | local Timer = @record { started: number, duration: number }
23 | function Timer:elapsed(): number
24 | return frametime - self.started
25 | end
26 | function Timer:delay(delay: number)
27 | self.started = self.started + delay
28 | end
29 | function Timer:progress(): number
30 | if self.duration == 0 then return 1.0 end
31 | return math.min(self:elapsed() / self.duration, 1.0)
32 | end
33 | function Timer:finished(): boolean
34 | if self.duration == 0 then return false end
35 | return (frametime - self.started) >= self.duration
36 | end
37 | function Timer:restart()
38 | self.started = frametime
39 | end
40 | function Timer.create(duration: number): Timer
41 | return Timer{frametime, duration}
42 | end
43 | function Timer.create_delayed(duration: number, delay: number): Timer
44 | return Timer{frametime + delay, duration}
45 | end
46 |
47 | -- TileAnim
48 | local TileAnimKind = @enum { NONE=0, MOVE, RAISE, MERGE}
49 | local TileAnim = @record {
50 | kind: TileAnimKind,
51 | n: integer,
52 | timer: Timer,
53 | movepos: Vector2
54 | }
55 | function TileAnim.createMove(n: integer, duration: number, movepos: Vector2): TileAnim
56 | return TileAnim{kind = TileAnimKind.MOVE, n=n, timer=Timer.create(duration), movepos = movepos}
57 | end
58 | function TileAnim.createRaise(n: integer, duration: number): TileAnim
59 | return TileAnim{kind = TileAnimKind.RAISE, n=n, timer=Timer.create(duration)}
60 | end
61 | function TileAnim.createMerge(n: integer, duration: number, delay: number): TileAnim
62 | return TileAnim{kind = TileAnimKind.MERGE, n=n, timer=Timer.create_delayed(duration, delay)}
63 | end
64 |
65 | -- Game variables
66 | local TileMap = @[TILE_COUNT][TILE_COUNT]integer
67 | local tiles: TileMap
68 | local AnimTileMap = @[TILE_COUNT][TILE_COUNT]vector(TileAnim)
69 | local tileanims: AnimTileMap
70 | local statetimer: Timer
71 | local score: integer
72 | local GameState = @enum{ IDLE=0, NEW, SPAWNING, SLIDING }
73 | local gamestate: GameState
74 | local notify: record{text:string, timer:Timer}
75 |
76 | local function set_game_state(state: GameState, duration: number)
77 | gamestate = state
78 | statetimer = Timer.create(duration)
79 | end
80 |
81 | local function clear_animations()
82 | for x=0,TILE_COUNT-1 do
83 | for y=0,TILE_COUNT-1 do
84 | tileanims[x][y]:clear()
85 | end
86 | end
87 | end
88 |
89 | local function get_random_avaiable_tile(): (integer, integer)
90 | local availables: [(TILE_COUNT*TILE_COUNT)]record{x: integer, y: integer}
91 | local index = 0
92 | for x=0,TILE_COUNT-1 do
93 | for y=0,TILE_COUNT-1 do
94 | if tiles[x][y] == 0 then
95 | availables[index] = {x, y}
96 | index = index + 1
97 | end
98 | end
99 | end
100 | if index == 0 then return -1, -1 end
101 | index = math.random(0, index-1)
102 | return availables[index].x, availables[index].y
103 | end
104 |
105 | local function spawn_tile(duration: number)
106 | local x, y = get_random_avaiable_tile()
107 | if x == -1 then return end
108 | tiles[x][y] = 1
109 | tileanims[x][y]:push(TileAnim.createRaise(1, duration))
110 | end
111 |
112 | local function destroy_animations()
113 | for x=0,TILE_COUNT-1 do
114 | for y=0,TILE_COUNT-1 do
115 | tileanims[x][y]:destroy()
116 | end
117 | end
118 | end
119 |
120 | local function destroy_notify()
121 | notify.text:destroy()
122 | notify = {}
123 | end
124 |
125 | local function reset_game()
126 | local NEW_DURATION = 0.1
127 | tiles = (@TileMap)()
128 | destroy_animations()
129 | destroy_notify()
130 | score = 0
131 | statetimer = {}
132 | spawn_tile(NEW_DURATION)
133 | spawn_tile(NEW_DURATION)
134 | set_game_state(GameState.NEW, NEW_DURATION)
135 | end
136 |
137 | local function slide_tiles(keydir: integer)
138 | local SLIDE_DURATION = 0.1
139 | local MERGE_DURATION = 0.2
140 | local slidden = false
141 | local addscore = 0
142 | clear_animations()
143 |
144 | ## function macro_process_tile()
145 | local n = tiles[x][y]
146 | local movepos: Vector2 = {x, y}
147 | tileanims[x][y]:push(TileAnim.createMove(n, SLIDE_DURATION, movepos))
148 | if n > 0 then
149 | local nn = n
150 | if ln == n then
151 | nn = n + 1
152 | addscore = addscore + (1 << nn)
153 | ln = 0
154 | else
155 | ln = n
156 | lx = lx + lxs
157 | ly = ly + lys
158 | end
159 | if y ~= ly or x ~= lx then
160 | tileanims[x][y][0].movepos = {lx, ly}
161 | tiles[x][y] = 0
162 | tiles[lx][ly] = nn
163 | if n ~= nn then
164 | tileanims[lx][ly]:push(TileAnim.createMerge(nn, MERGE_DURATION, SLIDE_DURATION))
165 | end
166 | slidden = true
167 | end
168 | end
169 | ## end
170 |
171 | if keydir == KeyboardKey.KEY_UP then
172 | local lxs, lys = 0, 1
173 | for x=0,TILE_COUNT-1,1 do
174 | local lx, ly, ln = x, -1, 0
175 | for y=0,TILE_COUNT-1,1 do
176 | ## macro_process_tile()
177 | end
178 | end
179 | elseif keydir == KeyboardKey.KEY_DOWN then
180 | local lxs, lys = 0, -1
181 | for x=0,TILE_COUNT-1 do
182 | local lx, ly, ln = x, TILE_COUNT, 0
183 | for y=TILE_COUNT-1,0,-1 do
184 | ## macro_process_tile()
185 | end
186 | end
187 | elseif keydir == KeyboardKey.KEY_LEFT then
188 | local lxs, lys = 1, 0
189 | for y=0,TILE_COUNT-1 do
190 | local lx, ly, ln = -1, y, 0
191 | for x=0,TILE_COUNT-1,1 do
192 | ## macro_process_tile()
193 | end
194 | end
195 | elseif keydir == KeyboardKey.KEY_RIGHT then
196 | local lxs, lys = -1, 0
197 | for y=0,TILE_COUNT-1 do
198 | local lx, ly, ln = TILE_COUNT, y, 0
199 | for x=TILE_COUNT-1,0,-1 do
200 | ## macro_process_tile()
201 | end
202 | end
203 | end
204 |
205 | if slidden then
206 | set_game_state(GameState.SLIDING, SLIDE_DURATION)
207 | else
208 | clear_animations()
209 | end
210 |
211 | if addscore > 0 then
212 | score = score + addscore
213 | destroy_notify()
214 | notify = {string.format('+%d', addscore), Timer.create(1.0)}
215 | end
216 | end
217 |
218 | local function get_tile_rect(x: number, y: number): Rectangle
219 | return (@Rectangle){
220 | TILEMAP_OFFSET.x + (x+1)*TILE_SPACING + x*TILE_WIDTH,
221 | TILEMAP_OFFSET.y + (y+1)*TILE_SPACING + y*TILE_WIDTH,
222 | TILE_WIDTH, TILE_WIDTH}
223 | end
224 |
225 | local function draw_boxed_text(text: string, rect: Rectangle, fontsize: integer, fgcolor: Color)
226 | if #text == 0 then return end
227 | local font = GetFontDefault()
228 | local spacing = math.ceil(fontsize / 20)
229 | local textsize = MeasureTextEx(font, text, fontsize, spacing)
230 | local pos: Vector2 = { rect.x + (rect.width - textsize.x) // 2,
231 | rect.y + (rect.height - textsize.y) // 2 }
232 | DrawTextEx(font, text, pos, fontsize, spacing, fgcolor)
233 | end
234 |
235 | local function draw_tiles_grid()
236 | local bgrect: Rectangle = { TILEMAP_OFFSET.x, TILEMAP_OFFSET.y, TILEMAP_WIDTH, TILEMAP_WIDTH }
237 | DrawRectangleRec(bgrect, GetColor(0xBBADA0FF))
238 | for i=0,TILE_COUNT-1 do
239 | for j=0,TILE_COUNT-1 do
240 | DrawRectangleRec(get_tile_rect(i, j), GetColor(0xCDC1B4FF))
241 | end
242 | end
243 | end
244 |
245 | local TILE_COLORS: [10]record{fg: Color, bg: Color} = {
246 | {fg=GetColor(0x776E65FF), bg=GetColor(0xEEE4DAFF)}, -- 2
247 | {fg=GetColor(0x776E65FF), bg=GetColor(0xEDE0C8FF)}, -- 4
248 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xF59563FF)}, -- 16
249 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xF67C5FFF)}, -- 32
250 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xF65E3BFF)}, -- 64
251 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xEDCF72FF)}, -- 128
252 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xEDCC61FF)}, -- 256
253 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xEDC850FF)}, -- 512
254 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xDDB513FF)}, -- 1024
255 | {fg=GetColor(0xFFFFFFFF), bg=GetColor(0xEDC22EFF)} -- 2048
256 | }
257 |
258 | local function scale_rect(rect: Rectangle, scale: number): Rectangle
259 | local newrect: Rectangle
260 | newrect.width = rect.width * scale
261 | newrect.height = rect.height * scale
262 | newrect.x = rect.x + (rect.width - newrect.width) / 2
263 | newrect.y = rect.y + (rect.height - newrect.height) / 2
264 | return newrect
265 | end
266 |
267 | local function draw_tile(x: number, y: number, num: integer, scale: number, opacity: number)
268 | if num == 0 then return end
269 | local color = TILE_COLORS[(num-1) % #TILE_COLORS]
270 | local rect = scale_rect(get_tile_rect(x, y), scale)
271 | local fontsize = (@integer)(math.ceil(8*scale))*5
272 | DrawRectangleRec(rect, Fade(color.bg, opacity))
273 | local tiletext = tostring(1 << num)
274 | draw_boxed_text(tiletext, rect, fontsize, Fade(color.fg, opacity))
275 | tiletext:destroy()
276 | end
277 |
278 | local function ease_in_back(x: number): number
279 | return (1.70158+1)*x*x*x - 1.70158*x*x
280 | end
281 | local function ease_out_back(x: number): number
282 | return 1-ease_in_back(1-x)
283 | end
284 |
285 | local function draw_tiles()
286 | for x=0,TILE_COUNT-1 do
287 | for y=0,TILE_COUNT-1 do
288 | local opacity = 1
289 | local scale = 1
290 | local pos: Vector2 = {x, y}
291 | local num = tiles[x][y]
292 | local animcount = #tileanims[x][y]
293 | if animcount > 0 then
294 | for i=0,animcount-1 do
295 | local anim = &tileanims[x][y][i]
296 | if not anim.timer:finished() then
297 | num = anim.n
298 | local fact = anim.timer:progress()
299 | if anim.kind == TileAnimKind.MOVE then
300 | pos = pos*(1-fact) + anim.movepos * fact
301 | elseif anim.kind == TileAnimKind.RAISE then
302 | opacity = fact*fact
303 | elseif anim.kind == TileAnimKind.MERGE then
304 | scale = ease_out_back(fact)
305 | end
306 | break
307 | end
308 | end
309 | end
310 | draw_tile(pos.x, pos.y, num, scale, opacity)
311 | end
312 | end
313 | end
314 |
315 | local function draw_title()
316 | draw_boxed_text('2048', {44, 44, 200, 128}, 80, GetColor(0x776E65FF))
317 | end
318 |
319 | local function draw_score()
320 | local rect: Rectangle = {SCREEN_WIDTH - 128 - 44, 48, 128, 96}
321 | local titlerect: Rectangle = {rect.x, rect.y + 8, rect.width, 20}
322 | local textrect: Rectangle = {rect.x, rect.y + 8, rect.width, rect.height}
323 | DrawRectangleRec(rect, GetColor(0xBBADA0FF))
324 | draw_boxed_text('Score', titlerect, 20, GetColor(0xEEE4DAFF))
325 | local scoretext = tostring(score)
326 | draw_boxed_text(scoretext, textrect, 40, RAYWHITE)
327 | scoretext:destroy()
328 | end
329 |
330 | local function draw_buttons()
331 | DrawRectangleRec(NEWBUTTON_RECT, GetColor(0x8F7A66FF))
332 | draw_boxed_text('New Game', NEWBUTTON_RECT, 20, RAYWHITE)
333 | end
334 |
335 | local function draw_notifications()
336 | if notify.timer:finished() then return end
337 | local f = notify.timer:progress()
338 | local opacity = 1 - f*f
339 | local rect: Rectangle = {SCREEN_WIDTH//2, 128 - f * 128, 128, 96}
340 | draw_boxed_text(notify.text, rect, 60, Fade(BLACK, opacity))
341 | end
342 |
343 | local function draw()
344 | BeginDrawing()
345 | ClearBackground(GetColor(0xFAF8EFFF))
346 | draw_tiles_grid()
347 | draw_tiles()
348 | draw_title()
349 | draw_score()
350 | draw_buttons()
351 | draw_notifications()
352 | EndDrawing()
353 | end
354 |
355 | local function check_slide(gesture: cint)
356 | if gamestate == GameState.SLIDING or gamestate == GameState.NEW then return end
357 | if IsKeyPressed(KeyboardKey.KEY_UP) or gesture == GESTURE_SWIPE_UP then
358 | slide_tiles(KeyboardKey.KEY_UP)
359 | elseif IsKeyPressed(KeyboardKey.KEY_DOWN) or gesture == GESTURE_SWIPE_DOWN then
360 | slide_tiles(KeyboardKey.KEY_DOWN)
361 | elseif IsKeyPressed(KeyboardKey.KEY_LEFT) or gesture == GESTURE_SWIPE_LEFT then
362 | slide_tiles(KeyboardKey.KEY_LEFT)
363 | elseif IsKeyPressed(KeyboardKey.KEY_RIGHT) or gesture == GESTURE_SWIPE_RIGHT then
364 | slide_tiles(KeyboardKey.KEY_RIGHT)
365 | end
366 | end
367 |
368 | local function check_newgame(gesture: cint)
369 | if gesture == GESTURE_TAP and
370 | CheckCollisionPointRec(GetTouchPosition(0), NEWBUTTON_RECT) then
371 | reset_game()
372 | end
373 | end
374 |
375 | local function update()
376 | local gesture = GetGestureDetected()
377 | check_slide(gesture)
378 | check_newgame(gesture)
379 |
380 | if statetimer:finished() then
381 | if gamestate == GameState.SLIDING then
382 | local SPAWN_DURATION = 0.1
383 | spawn_tile(SPAWN_DURATION)
384 | set_game_state(GameState.SPAWNING, SPAWN_DURATION)
385 | elseif gamestate == GameState.SPAWNING or gamestate == GameState.NEW then
386 | clear_animations()
387 | set_game_state(GameState.IDLE, 0)
388 | end
389 | end
390 | end
391 |
392 | local function frame()
393 | frametime = GetTime()
394 | update()
395 | draw()
396 |
397 | ## if PLATFORM_WEB and not pragmas.nogc then
398 | gc:run() -- safe to collect garbage here
399 | ## end
400 | end
401 |
402 | local function init()
403 | ## if PLATFORM_WEB and not pragmas.nogc then
404 | gc:pause() -- conservative GCs cannot run automatically with emscripten
405 | ## end
406 |
407 | -- SetTargetFPS is not allowed on web
408 | ## if not PLATFORM_WEB then
409 | SetTargetFPS(60)
410 | ## end
411 |
412 | SetGesturesEnabled(GESTURE_SWIPE_UP | GESTURE_SWIPE_DOWN |
413 | GESTURE_SWIPE_LEFT | GESTURE_SWIPE_RIGHT |
414 | GESTURE_TAP)
415 | InitWindow(SCREEN_WIDTH, SCREEN_HEIGH, "2048 Game")
416 | frametime = GetTime()
417 | reset_game()
418 | end
419 |
420 | local function terminate()
421 | destroy_animations()
422 | destroy_notify()
423 | CloseWindow()
424 | end
425 |
426 | -- Setup Window and Game
427 | init()
428 |
429 | -- Main game loop
430 | ## if PLATFORM_WEB then
431 | local function emscripten_set_main_loop(func: function(), fps: cint, infloop: cint) ',nodecl> end
432 | emscripten_set_main_loop(frame, 0, 1)
433 | ## else
434 | repeat
435 | frame()
436 | until WindowShouldClose()
437 | ## end
438 |
439 | -- Cleanup
440 | terminate()
441 |
--------------------------------------------------------------------------------
/raylib.nelua:
--------------------------------------------------------------------------------
1 | ##[[
2 | cinclude ''
3 | cinclude ''
4 | linklib 'raylib'
5 | if ccinfo.is_windows then
6 | linklib 'glfw3'
7 | else
8 | linklib 'glfw'
9 | end
10 | ]]
11 | global Vector2: type = @record{
12 | x: float32,
13 | y: float32
14 | }
15 | global Vector3: type = @record{
16 | x: float32,
17 | y: float32,
18 | z: float32
19 | }
20 | global Vector4: type = @record{
21 | x: float32,
22 | y: float32,
23 | z: float32,
24 | w: float32
25 | }
26 | global Quaternion: type = @Vector4
27 | global Matrix: type = @record{
28 | m0: float32,
29 | m4: float32,
30 | m8: float32,
31 | m12: float32,
32 | m1: float32,
33 | m5: float32,
34 | m9: float32,
35 | m13: float32,
36 | m2: float32,
37 | m6: float32,
38 | m10: float32,
39 | m14: float32,
40 | m3: float32,
41 | m7: float32,
42 | m11: float32,
43 | m15: float32
44 | }
45 | global Color: type = @record{
46 | r: cuchar,
47 | g: cuchar,
48 | b: cuchar,
49 | a: cuchar
50 | }
51 | global Rectangle: type = @record{
52 | x: float32,
53 | y: float32,
54 | width: float32,
55 | height: float32
56 | }
57 | global Image: type = @record{
58 | data: pointer,
59 | width: cint,
60 | height: cint,
61 | mipmaps: cint,
62 | format: cint
63 | }
64 | global Texture: type = @record{
65 | id: cuint,
66 | width: cint,
67 | height: cint,
68 | mipmaps: cint,
69 | format: cint
70 | }
71 | global Texture2D: type = @Texture
72 | global TextureCubemap: type = @Texture
73 | global RenderTexture: type = @record{
74 | id: cuint,
75 | texture: Texture,
76 | depth: Texture
77 | }
78 | global RenderTexture2D: type = @RenderTexture
79 | global NPatchInfo: type = @record{
80 | source: Rectangle,
81 | left: cint,
82 | top: cint,
83 | right: cint,
84 | bottom: cint,
85 | layout: cint
86 | }
87 | global GlyphInfo: type = @record{
88 | value: cint,
89 | offsetX: cint,
90 | offsetY: cint,
91 | advanceX: cint,
92 | image: Image
93 | }
94 | global Font: type = @record{
95 | baseSize: cint,
96 | glyphCount: cint,
97 | glyphPadding: cint,
98 | texture: Texture2D,
99 | recs: *Rectangle,
100 | glyphs: *GlyphInfo
101 | }
102 | global Camera3D: type = @record{
103 | position: Vector3,
104 | target: Vector3,
105 | up: Vector3,
106 | fovy: float32,
107 | projection: cint
108 | }
109 | global Camera: type = @Camera3D
110 | global Camera2D: type = @record{
111 | offset: Vector2,
112 | target: Vector2,
113 | rotation: float32,
114 | zoom: float32
115 | }
116 | global Mesh: type = @record{
117 | vertexCount: cint,
118 | triangleCount: cint,
119 | vertices: *float32,
120 | texcoords: *float32,
121 | texcoords2: *float32,
122 | normals: *float32,
123 | tangents: *float32,
124 | colors: *cuchar,
125 | indices: *cushort,
126 | animVertices: *float32,
127 | animNormals: *float32,
128 | boneIds: *cuchar,
129 | boneWeights: *float32,
130 | vaoId: cuint,
131 | vboId: *cuint
132 | }
133 | global Shader: type = @record{
134 | id: cuint,
135 | locs: *cint
136 | }
137 | global MaterialMap: type = @record{
138 | texture: Texture2D,
139 | color: Color,
140 | value: float32
141 | }
142 | global Material: type = @record{
143 | shader: Shader,
144 | maps: *MaterialMap,
145 | params: [4]float32
146 | }
147 | global Transform: type = @record{
148 | translation: Vector3,
149 | rotation: Quaternion,
150 | scale: Vector3
151 | }
152 | global BoneInfo: type = @record{
153 | name: [32]cchar,
154 | parent: cint
155 | }
156 | global Model: type = @record{
157 | transform: Matrix,
158 | meshCount: cint,
159 | materialCount: cint,
160 | meshes: *Mesh,
161 | materials: *Material,
162 | meshMaterial: *cint,
163 | boneCount: cint,
164 | bones: *BoneInfo,
165 | bindPose: *Transform
166 | }
167 | global ModelAnimation: type = @record{
168 | boneCount: cint,
169 | frameCount: cint,
170 | bones: *BoneInfo,
171 | framePoses: **Transform
172 | }
173 | global Ray: type = @record{
174 | position: Vector3,
175 | direction: Vector3
176 | }
177 | global RayCollision: type = @record{
178 | hit: boolean,
179 | distance: float32,
180 | point: Vector3,
181 | normal: Vector3
182 | }
183 | global BoundingBox: type = @record{
184 | min: Vector3,
185 | max: Vector3
186 | }
187 | global Wave: type = @record{
188 | frameCount: cuint,
189 | sampleRate: cuint,
190 | sampleSize: cuint,
191 | channels: cuint,
192 | data: pointer
193 | }
194 | global rAudioBuffer: type = @record{}
195 | global AudioStream: type = @record{
196 | buffer: *rAudioBuffer,
197 | sampleRate: cuint,
198 | sampleSize: cuint,
199 | channels: cuint
200 | }
201 | global Sound: type = @record{
202 | stream: AudioStream,
203 | frameCount: cuint
204 | }
205 | global Music: type = @record{
206 | stream: AudioStream,
207 | frameCount: cuint,
208 | looping: boolean,
209 | ctxType: cint,
210 | ctxData: pointer
211 | }
212 | global VrDeviceInfo: type = @record{
213 | hResolution: cint,
214 | vResolution: cint,
215 | hScreenSize: float32,
216 | vScreenSize: float32,
217 | vScreenCenter: float32,
218 | eyeToScreenDistance: float32,
219 | lensSeparationDistance: float32,
220 | interpupillaryDistance: float32,
221 | lensDistortionValues: [4]float32,
222 | chromaAbCorrection: [4]float32
223 | }
224 | global VrStereoConfig: type = @record{
225 | projection: [2]Matrix,
226 | viewOffset: [2]Matrix,
227 | leftLensCenter: [2]float32,
228 | rightLensCenter: [2]float32,
229 | leftScreenCenter: [2]float32,
230 | rightScreenCenter: [2]float32,
231 | scale: [2]float32,
232 | scaleIn: [2]float32
233 | }
234 | global ConfigFlags: type = @enum(cint){
235 | FLAG_VSYNC_HINT = 64,
236 | FLAG_FULLSCREEN_MODE = 2,
237 | FLAG_WINDOW_RESIZABLE = 4,
238 | FLAG_WINDOW_UNDECORATED = 8,
239 | FLAG_WINDOW_HIDDEN = 128,
240 | FLAG_WINDOW_MINIMIZED = 512,
241 | FLAG_WINDOW_MAXIMIZED = 1024,
242 | FLAG_WINDOW_UNFOCUSED = 2048,
243 | FLAG_WINDOW_TOPMOST = 4096,
244 | FLAG_WINDOW_ALWAYS_RUN = 256,
245 | FLAG_WINDOW_TRANSPARENT = 16,
246 | FLAG_WINDOW_HIGHDPI = 8192,
247 | FLAG_MSAA_4X_HINT = 32,
248 | FLAG_INTERLACED_HINT = 65536
249 | }
250 | global TraceLogLevel: type = @enum(cint){
251 | LOG_ALL = 0,
252 | LOG_TRACE = 1,
253 | LOG_DEBUG = 2,
254 | LOG_INFO = 3,
255 | LOG_WARNING = 4,
256 | LOG_ERROR = 5,
257 | LOG_FATAL = 6,
258 | LOG_NONE = 7
259 | }
260 | global KeyboardKey: type = @enum(cint){
261 | KEY_NULL = 0,
262 | KEY_APOSTROPHE = 39,
263 | KEY_COMMA = 44,
264 | KEY_MINUS = 45,
265 | KEY_PERIOD = 46,
266 | KEY_SLASH = 47,
267 | KEY_ZERO = 48,
268 | KEY_ONE = 49,
269 | KEY_TWO = 50,
270 | KEY_THREE = 51,
271 | KEY_FOUR = 52,
272 | KEY_FIVE = 53,
273 | KEY_SIX = 54,
274 | KEY_SEVEN = 55,
275 | KEY_EIGHT = 56,
276 | KEY_NINE = 57,
277 | KEY_SEMICOLON = 59,
278 | KEY_EQUAL = 61,
279 | KEY_A = 65,
280 | KEY_B = 66,
281 | KEY_C = 67,
282 | KEY_D = 68,
283 | KEY_E = 69,
284 | KEY_F = 70,
285 | KEY_G = 71,
286 | KEY_H = 72,
287 | KEY_I = 73,
288 | KEY_J = 74,
289 | KEY_K = 75,
290 | KEY_L = 76,
291 | KEY_M = 77,
292 | KEY_N = 78,
293 | KEY_O = 79,
294 | KEY_P = 80,
295 | KEY_Q = 81,
296 | KEY_R = 82,
297 | KEY_S = 83,
298 | KEY_T = 84,
299 | KEY_U = 85,
300 | KEY_V = 86,
301 | KEY_W = 87,
302 | KEY_X = 88,
303 | KEY_Y = 89,
304 | KEY_Z = 90,
305 | KEY_LEFT_BRACKET = 91,
306 | KEY_BACKSLASH = 92,
307 | KEY_RIGHT_BRACKET = 93,
308 | KEY_GRAVE = 96,
309 | KEY_SPACE = 32,
310 | KEY_ESCAPE = 256,
311 | KEY_ENTER = 257,
312 | KEY_TAB = 258,
313 | KEY_BACKSPACE = 259,
314 | KEY_INSERT = 260,
315 | KEY_DELETE = 261,
316 | KEY_RIGHT = 262,
317 | KEY_LEFT = 263,
318 | KEY_DOWN = 264,
319 | KEY_UP = 265,
320 | KEY_PAGE_UP = 266,
321 | KEY_PAGE_DOWN = 267,
322 | KEY_HOME = 268,
323 | KEY_END = 269,
324 | KEY_CAPS_LOCK = 280,
325 | KEY_SCROLL_LOCK = 281,
326 | KEY_NUM_LOCK = 282,
327 | KEY_PRINT_SCREEN = 283,
328 | KEY_PAUSE = 284,
329 | KEY_F1 = 290,
330 | KEY_F2 = 291,
331 | KEY_F3 = 292,
332 | KEY_F4 = 293,
333 | KEY_F5 = 294,
334 | KEY_F6 = 295,
335 | KEY_F7 = 296,
336 | KEY_F8 = 297,
337 | KEY_F9 = 298,
338 | KEY_F10 = 299,
339 | KEY_F11 = 300,
340 | KEY_F12 = 301,
341 | KEY_LEFT_SHIFT = 340,
342 | KEY_LEFT_CONTROL = 341,
343 | KEY_LEFT_ALT = 342,
344 | KEY_LEFT_SUPER = 343,
345 | KEY_RIGHT_SHIFT = 344,
346 | KEY_RIGHT_CONTROL = 345,
347 | KEY_RIGHT_ALT = 346,
348 | KEY_RIGHT_SUPER = 347,
349 | KEY_KB_MENU = 348,
350 | KEY_KP_0 = 320,
351 | KEY_KP_1 = 321,
352 | KEY_KP_2 = 322,
353 | KEY_KP_3 = 323,
354 | KEY_KP_4 = 324,
355 | KEY_KP_5 = 325,
356 | KEY_KP_6 = 326,
357 | KEY_KP_7 = 327,
358 | KEY_KP_8 = 328,
359 | KEY_KP_9 = 329,
360 | KEY_KP_DECIMAL = 330,
361 | KEY_KP_DIVIDE = 331,
362 | KEY_KP_MULTIPLY = 332,
363 | KEY_KP_SUBTRACT = 333,
364 | KEY_KP_ADD = 334,
365 | KEY_KP_ENTER = 335,
366 | KEY_KP_EQUAL = 336,
367 | KEY_BACK = 4,
368 | KEY_MENU = 82,
369 | KEY_VOLUME_UP = 24,
370 | KEY_VOLUME_DOWN = 25
371 | }
372 | global MouseButton: type = @enum(cint){
373 | MOUSE_BUTTON_LEFT = 0,
374 | MOUSE_BUTTON_RIGHT = 1,
375 | MOUSE_BUTTON_MIDDLE = 2,
376 | MOUSE_BUTTON_SIDE = 3,
377 | MOUSE_BUTTON_EXTRA = 4,
378 | MOUSE_BUTTON_FORWARD = 5,
379 | MOUSE_BUTTON_BACK = 6
380 | }
381 | global MouseCursor: type = @enum(cint){
382 | MOUSE_CURSOR_DEFAULT = 0,
383 | MOUSE_CURSOR_ARROW = 1,
384 | MOUSE_CURSOR_IBEAM = 2,
385 | MOUSE_CURSOR_CROSSHAIR = 3,
386 | MOUSE_CURSOR_POINTING_HAND = 4,
387 | MOUSE_CURSOR_RESIZE_EW = 5,
388 | MOUSE_CURSOR_RESIZE_NS = 6,
389 | MOUSE_CURSOR_RESIZE_NWSE = 7,
390 | MOUSE_CURSOR_RESIZE_NESW = 8,
391 | MOUSE_CURSOR_RESIZE_ALL = 9,
392 | MOUSE_CURSOR_NOT_ALLOWED = 10
393 | }
394 | global GamepadButton: type = @enum(cint){
395 | GAMEPAD_BUTTON_UNKNOWN = 0,
396 | GAMEPAD_BUTTON_LEFT_FACE_UP = 1,
397 | GAMEPAD_BUTTON_LEFT_FACE_RIGHT = 2,
398 | GAMEPAD_BUTTON_LEFT_FACE_DOWN = 3,
399 | GAMEPAD_BUTTON_LEFT_FACE_LEFT = 4,
400 | GAMEPAD_BUTTON_RIGHT_FACE_UP = 5,
401 | GAMEPAD_BUTTON_RIGHT_FACE_RIGHT = 6,
402 | GAMEPAD_BUTTON_RIGHT_FACE_DOWN = 7,
403 | GAMEPAD_BUTTON_RIGHT_FACE_LEFT = 8,
404 | GAMEPAD_BUTTON_LEFT_TRIGGER_1 = 9,
405 | GAMEPAD_BUTTON_LEFT_TRIGGER_2 = 10,
406 | GAMEPAD_BUTTON_RIGHT_TRIGGER_1 = 11,
407 | GAMEPAD_BUTTON_RIGHT_TRIGGER_2 = 12,
408 | GAMEPAD_BUTTON_MIDDLE_LEFT = 13,
409 | GAMEPAD_BUTTON_MIDDLE = 14,
410 | GAMEPAD_BUTTON_MIDDLE_RIGHT = 15,
411 | GAMEPAD_BUTTON_LEFT_THUMB = 16,
412 | GAMEPAD_BUTTON_RIGHT_THUMB = 17
413 | }
414 | global GamepadAxis: type = @enum(cint){
415 | GAMEPAD_AXIS_LEFT_X = 0,
416 | GAMEPAD_AXIS_LEFT_Y = 1,
417 | GAMEPAD_AXIS_RIGHT_X = 2,
418 | GAMEPAD_AXIS_RIGHT_Y = 3,
419 | GAMEPAD_AXIS_LEFT_TRIGGER = 4,
420 | GAMEPAD_AXIS_RIGHT_TRIGGER = 5
421 | }
422 | global MaterialMapIndex: type = @enum(cint){
423 | MATERIAL_MAP_ALBEDO = 0,
424 | MATERIAL_MAP_METALNESS = 1,
425 | MATERIAL_MAP_NORMAL = 2,
426 | MATERIAL_MAP_ROUGHNESS = 3,
427 | MATERIAL_MAP_OCCLUSION = 4,
428 | MATERIAL_MAP_EMISSION = 5,
429 | MATERIAL_MAP_HEIGHT = 6,
430 | MATERIAL_MAP_CUBEMAP = 7,
431 | MATERIAL_MAP_IRRADIANCE = 8,
432 | MATERIAL_MAP_PREFILTER = 9,
433 | MATERIAL_MAP_BRDF = 10
434 | }
435 | global ShaderLocationIndex: type = @enum(cint){
436 | SHADER_LOC_VERTEX_POSITION = 0,
437 | SHADER_LOC_VERTEX_TEXCOORD01 = 1,
438 | SHADER_LOC_VERTEX_TEXCOORD02 = 2,
439 | SHADER_LOC_VERTEX_NORMAL = 3,
440 | SHADER_LOC_VERTEX_TANGENT = 4,
441 | SHADER_LOC_VERTEX_COLOR = 5,
442 | SHADER_LOC_MATRIX_MVP = 6,
443 | SHADER_LOC_MATRIX_VIEW = 7,
444 | SHADER_LOC_MATRIX_PROJECTION = 8,
445 | SHADER_LOC_MATRIX_MODEL = 9,
446 | SHADER_LOC_MATRIX_NORMAL = 10,
447 | SHADER_LOC_VECTOR_VIEW = 11,
448 | SHADER_LOC_COLOR_DIFFUSE = 12,
449 | SHADER_LOC_COLOR_SPECULAR = 13,
450 | SHADER_LOC_COLOR_AMBIENT = 14,
451 | SHADER_LOC_MAP_ALBEDO = 15,
452 | SHADER_LOC_MAP_METALNESS = 16,
453 | SHADER_LOC_MAP_NORMAL = 17,
454 | SHADER_LOC_MAP_ROUGHNESS = 18,
455 | SHADER_LOC_MAP_OCCLUSION = 19,
456 | SHADER_LOC_MAP_EMISSION = 20,
457 | SHADER_LOC_MAP_HEIGHT = 21,
458 | SHADER_LOC_MAP_CUBEMAP = 22,
459 | SHADER_LOC_MAP_IRRADIANCE = 23,
460 | SHADER_LOC_MAP_PREFILTER = 24,
461 | SHADER_LOC_MAP_BRDF = 25
462 | }
463 | global ShaderUniformDataType: type = @enum(cint){
464 | SHADER_UNIFORM_FLOAT = 0,
465 | SHADER_UNIFORM_VEC2 = 1,
466 | SHADER_UNIFORM_VEC3 = 2,
467 | SHADER_UNIFORM_VEC4 = 3,
468 | SHADER_UNIFORM_INT = 4,
469 | SHADER_UNIFORM_IVEC2 = 5,
470 | SHADER_UNIFORM_IVEC3 = 6,
471 | SHADER_UNIFORM_IVEC4 = 7,
472 | SHADER_UNIFORM_SAMPLER2D = 8
473 | }
474 | global ShaderAttributeDataType: type = @enum(cint){
475 | SHADER_ATTRIB_FLOAT = 0,
476 | SHADER_ATTRIB_VEC2 = 1,
477 | SHADER_ATTRIB_VEC3 = 2,
478 | SHADER_ATTRIB_VEC4 = 3
479 | }
480 | global PixelFormat: type = @enum(cint){
481 | PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1,
482 | PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA = 2,
483 | PIXELFORMAT_UNCOMPRESSED_R5G6B5 = 3,
484 | PIXELFORMAT_UNCOMPRESSED_R8G8B8 = 4,
485 | PIXELFORMAT_UNCOMPRESSED_R5G5B5A1 = 5,
486 | PIXELFORMAT_UNCOMPRESSED_R4G4B4A4 = 6,
487 | PIXELFORMAT_UNCOMPRESSED_R8G8B8A8 = 7,
488 | PIXELFORMAT_UNCOMPRESSED_R32 = 8,
489 | PIXELFORMAT_UNCOMPRESSED_R32G32B32 = 9,
490 | PIXELFORMAT_UNCOMPRESSED_R32G32B32A32 = 10,
491 | PIXELFORMAT_COMPRESSED_DXT1_RGB = 11,
492 | PIXELFORMAT_COMPRESSED_DXT1_RGBA = 12,
493 | PIXELFORMAT_COMPRESSED_DXT3_RGBA = 13,
494 | PIXELFORMAT_COMPRESSED_DXT5_RGBA = 14,
495 | PIXELFORMAT_COMPRESSED_ETC1_RGB = 15,
496 | PIXELFORMAT_COMPRESSED_ETC2_RGB = 16,
497 | PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA = 17,
498 | PIXELFORMAT_COMPRESSED_PVRT_RGB = 18,
499 | PIXELFORMAT_COMPRESSED_PVRT_RGBA = 19,
500 | PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA = 20,
501 | PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA = 21
502 | }
503 | global TextureFilter: type = @enum(cint){
504 | TEXTURE_FILTER_POINT = 0,
505 | TEXTURE_FILTER_BILINEAR = 1,
506 | TEXTURE_FILTER_TRILINEAR = 2,
507 | TEXTURE_FILTER_ANISOTROPIC_4X = 3,
508 | TEXTURE_FILTER_ANISOTROPIC_8X = 4,
509 | TEXTURE_FILTER_ANISOTROPIC_16X = 5
510 | }
511 | global TextureWrap: type = @enum(cint){
512 | TEXTURE_WRAP_REPEAT = 0,
513 | TEXTURE_WRAP_CLAMP = 1,
514 | TEXTURE_WRAP_MIRROR_REPEAT = 2,
515 | TEXTURE_WRAP_MIRROR_CLAMP = 3
516 | }
517 | global CubemapLayout: type = @enum(cint){
518 | CUBEMAP_LAYOUT_AUTO_DETECT = 0,
519 | CUBEMAP_LAYOUT_LINE_VERTICAL = 1,
520 | CUBEMAP_LAYOUT_LINE_HORIZONTAL = 2,
521 | CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR = 3,
522 | CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE = 4,
523 | CUBEMAP_LAYOUT_PANORAMA = 5
524 | }
525 | global FontType: type = @enum(cint){
526 | FONT_DEFAULT = 0,
527 | FONT_BITMAP = 1,
528 | FONT_SDF = 2
529 | }
530 | global BlendMode: type = @enum(cint){
531 | BLEND_ALPHA = 0,
532 | BLEND_ADDITIVE = 1,
533 | BLEND_MULTIPLIED = 2,
534 | BLEND_ADD_COLORS = 3,
535 | BLEND_SUBTRACT_COLORS = 4,
536 | BLEND_CUSTOM = 5
537 | }
538 | global Gesture: type = @enum(cint){
539 | GESTURE_NONE = 0,
540 | GESTURE_TAP = 1,
541 | GESTURE_DOUBLETAP = 2,
542 | GESTURE_HOLD = 4,
543 | GESTURE_DRAG = 8,
544 | GESTURE_SWIPE_RIGHT = 16,
545 | GESTURE_SWIPE_LEFT = 32,
546 | GESTURE_SWIPE_UP = 64,
547 | GESTURE_SWIPE_DOWN = 128,
548 | GESTURE_PINCH_IN = 256,
549 | GESTURE_PINCH_OUT = 512
550 | }
551 | global CameraMode: type = @enum(cint){
552 | CAMERA_CUSTOM = 0,
553 | CAMERA_FREE = 1,
554 | CAMERA_ORBITAL = 2,
555 | CAMERA_FIRST_PERSON = 3,
556 | CAMERA_THIRD_PERSON = 4
557 | }
558 | global CameraProjection: type = @enum(cint){
559 | CAMERA_PERSPECTIVE = 0,
560 | CAMERA_ORTHOGRAPHIC = 1
561 | }
562 | global NPatchLayout: type = @enum(cint){
563 | NPATCH_NINE_PATCH = 0,
564 | NPATCH_THREE_PATCH_VERTICAL = 1,
565 | NPATCH_THREE_PATCH_HORIZONTAL = 2
566 | }
567 | global TraceLogCallback: type = @function(cint, cstring, cvalist): void
568 | global LoadFileDataCallback: type = @function(cstring, *cuint): *cuchar
569 | global SaveFileDataCallback: type = @function(cstring, pointer, cuint): boolean
570 | global LoadFileTextCallback: type = @function(cstring): cstring
571 | global SaveFileTextCallback: type = @function(cstring, cstring): boolean
572 | global function InitWindow(width: cint, height: cint, title: cstring): void end
573 | global function WindowShouldClose(): boolean end
574 | global function CloseWindow(): void end
575 | global function IsWindowReady(): boolean end
576 | global function IsWindowFullscreen(): boolean end
577 | global function IsWindowHidden(): boolean end
578 | global function IsWindowMinimized(): boolean end
579 | global function IsWindowMaximized(): boolean end
580 | global function IsWindowFocused(): boolean end
581 | global function IsWindowResized(): boolean end
582 | global function IsWindowState(flag: cuint): boolean end
583 | global function SetWindowState(flags: cuint): void end
584 | global function ClearWindowState(flags: cuint): void end
585 | global function ToggleFullscreen(): void end
586 | global function MaximizeWindow(): void end
587 | global function MinimizeWindow(): void end
588 | global function RestoreWindow(): void end
589 | global function SetWindowIcon(image: Image): void end
590 | global function SetWindowTitle(title: cstring): void end
591 | global function SetWindowPosition(x: cint, y: cint): void end
592 | global function SetWindowMonitor(monitor: cint): void end
593 | global function SetWindowMinSize(width: cint, height: cint): void end
594 | global function SetWindowSize(width: cint, height: cint): void end
595 | global function GetWindowHandle(): pointer end
596 | global function GetScreenWidth(): cint end
597 | global function GetScreenHeight(): cint end
598 | global function GetMonitorCount(): cint end
599 | global function GetCurrentMonitor(): cint end
600 | global function GetMonitorPosition(monitor: cint): Vector2 end
601 | global function GetMonitorWidth(monitor: cint): cint end
602 | global function GetMonitorHeight(monitor: cint): cint end
603 | global function GetMonitorPhysicalWidth(monitor: cint): cint end
604 | global function GetMonitorPhysicalHeight(monitor: cint): cint end
605 | global function GetMonitorRefreshRate(monitor: cint): cint end
606 | global function GetWindowPosition(): Vector2 end
607 | global function GetWindowScaleDPI(): Vector2 end
608 | global function GetMonitorName(monitor: cint): cstring end
609 | global function SetClipboardText(text: cstring): void end
610 | global function GetClipboardText(): cstring end
611 | global function SwapScreenBuffer(): void end
612 | global function PollInputEvents(): void end
613 | global function WaitTime(ms: float32): void end
614 | global function ShowCursor(): void end
615 | global function HideCursor(): void end
616 | global function IsCursorHidden(): boolean end
617 | global function EnableCursor(): void end
618 | global function DisableCursor(): void end
619 | global function IsCursorOnScreen(): boolean end
620 | global function ClearBackground(color: Color): void end
621 | global function BeginDrawing(): void end
622 | global function EndDrawing(): void end
623 | global function BeginMode2D(camera: Camera2D): void end
624 | global function EndMode2D(): void end
625 | global function BeginMode3D(camera: Camera3D): void end
626 | global function EndMode3D(): void end
627 | global function BeginTextureMode(target: RenderTexture2D): void end
628 | global function EndTextureMode(): void end
629 | global function BeginShaderMode(shader: Shader): void end
630 | global function EndShaderMode(): void end
631 | global function BeginBlendMode(mode: cint): void end
632 | global function EndBlendMode(): void end
633 | global function BeginScissorMode(x: cint, y: cint, width: cint, height: cint): void end
634 | global function EndScissorMode(): void end
635 | global function BeginVrStereoMode(config: VrStereoConfig): void end
636 | global function EndVrStereoMode(): void end
637 | global function LoadVrStereoConfig(device: VrDeviceInfo): VrStereoConfig end
638 | global function UnloadVrStereoConfig(config: VrStereoConfig): void end
639 | global function LoadShader(vsFileName: cstring, fsFileName: cstring): Shader end
640 | global function LoadShaderFromMemory(vsCode: cstring, fsCode: cstring): Shader end
641 | global function GetShaderLocation(shader: Shader, uniformName: cstring): cint end
642 | global function GetShaderLocationAttrib(shader: Shader, attribName: cstring): cint end
643 | global function SetShaderValue(shader: Shader, locIndex: cint, value: pointer, uniformType: cint): void end
644 | global function SetShaderValueV(shader: Shader, locIndex: cint, value: pointer, uniformType: cint, count: cint): void end
645 | global function SetShaderValueMatrix(shader: Shader, locIndex: cint, mat: Matrix): void end
646 | global function SetShaderValueTexture(shader: Shader, locIndex: cint, texture: Texture2D): void end
647 | global function UnloadShader(shader: Shader): void end
648 | global function GetMouseRay(mousePosition: Vector2, camera: Camera): Ray end
649 | global function GetCameraMatrix(camera: Camera): Matrix end
650 | global function GetCameraMatrix2D(camera: Camera2D): Matrix end
651 | global function GetWorldToScreen(position: Vector3, camera: Camera): Vector2 end
652 | global function GetWorldToScreenEx(position: Vector3, camera: Camera, width: cint, height: cint): Vector2 end
653 | global function GetWorldToScreen2D(position: Vector2, camera: Camera2D): Vector2 end
654 | global function GetScreenToWorld2D(position: Vector2, camera: Camera2D): Vector2 end
655 | global function SetTargetFPS(fps: cint): void end
656 | global function GetFPS(): cint end
657 | global function GetFrameTime(): float32 end
658 | global function GetTime(): float64 end
659 | global function GetRandomValue(min: cint, max: cint): cint end
660 | global function SetRandomSeed(seed: cuint): void end
661 | global function TakeScreenshot(fileName: cstring): void end
662 | global function SetConfigFlags(flags: cuint): void end
663 | global function TraceLog(logLevel: cint, text: cstring, ...: cvarargs): void end
664 | global function SetTraceLogLevel(logLevel: cint): void end
665 | global function MemAlloc(size: cint): pointer end
666 | global function MemRealloc(ptr: pointer, size: cint): pointer end
667 | global function MemFree(ptr: pointer): void end
668 | global function SetTraceLogCallback(callback: TraceLogCallback): void end
669 | global function SetLoadFileDataCallback(callback: LoadFileDataCallback): void end
670 | global function SetSaveFileDataCallback(callback: SaveFileDataCallback): void end
671 | global function SetLoadFileTextCallback(callback: LoadFileTextCallback): void end
672 | global function SetSaveFileTextCallback(callback: SaveFileTextCallback): void end
673 | global function LoadFileData(fileName: cstring, bytesRead: *cuint): *cuchar end
674 | global function UnloadFileData(data: *cuchar): void end
675 | global function SaveFileData(fileName: cstring, data: pointer, bytesToWrite: cuint): boolean end
676 | global function LoadFileText(fileName: cstring): cstring end
677 | global function UnloadFileText(text: cstring): void end
678 | global function SaveFileText(fileName: cstring, text: cstring): boolean end
679 | global function FileExists(fileName: cstring): boolean end
680 | global function DirectoryExists(dirPath: cstring): boolean end
681 | global function IsFileExtension(fileName: cstring, ext: cstring): boolean end
682 | global function GetFileExtension(fileName: cstring): cstring end
683 | global function GetFileName(filePath: cstring): cstring end
684 | global function GetFileNameWithoutExt(filePath: cstring): cstring end
685 | global function GetDirectoryPath(filePath: cstring): cstring end
686 | global function GetPrevDirectoryPath(dirPath: cstring): cstring end
687 | global function GetWorkingDirectory(): cstring end
688 | global function GetDirectoryFiles(dirPath: cstring, count: *cint): *cstring end
689 | global function ClearDirectoryFiles(): void end
690 | global function ChangeDirectory(dir: cstring): boolean end
691 | global function IsFileDropped(): boolean end
692 | global function GetDroppedFiles(count: *cint): *cstring end
693 | global function ClearDroppedFiles(): void end
694 | global function GetFileModTime(fileName: cstring): clong end
695 | global function CompressData(data: *cuchar, dataLength: cint, compDataLength: *cint): *cuchar end
696 | global function DecompressData(compData: *cuchar, compDataLength: cint, dataLength: *cint): *cuchar end
697 | global function EncodeDataBase64(data: *cuchar, dataLength: cint, outputLength: *cint): cstring end
698 | global function DecodeDataBase64(data: *cuchar, outputLength: *cint): *cuchar end
699 | global function SaveStorageValue(position: cuint, value: cint): boolean end
700 | global function LoadStorageValue(position: cuint): cint end
701 | global function OpenURL(url: cstring): void end
702 | global function IsKeyPressed(key: cint): boolean end
703 | global function IsKeyDown(key: cint): boolean end
704 | global function IsKeyReleased(key: cint): boolean end
705 | global function IsKeyUp(key: cint): boolean end
706 | global function SetExitKey(key: cint): void end
707 | global function GetKeyPressed(): cint end
708 | global function GetCharPressed(): cint end
709 | global function IsGamepadAvailable(gamepad: cint): boolean end
710 | global function GetGamepadName(gamepad: cint): cstring end
711 | global function IsGamepadButtonPressed(gamepad: cint, button: cint): boolean end
712 | global function IsGamepadButtonDown(gamepad: cint, button: cint): boolean end
713 | global function IsGamepadButtonReleased(gamepad: cint, button: cint): boolean end
714 | global function IsGamepadButtonUp(gamepad: cint, button: cint): boolean end
715 | global function GetGamepadButtonPressed(): cint end
716 | global function GetGamepadAxisCount(gamepad: cint): cint end
717 | global function GetGamepadAxisMovement(gamepad: cint, axis: cint): float32 end
718 | global function SetGamepadMappings(mappings: cstring): cint end
719 | global function IsMouseButtonPressed(button: cint): boolean end
720 | global function IsMouseButtonDown(button: cint): boolean end
721 | global function IsMouseButtonReleased(button: cint): boolean end
722 | global function IsMouseButtonUp(button: cint): boolean end
723 | global function GetMouseX(): cint end
724 | global function GetMouseY(): cint end
725 | global function GetMousePosition(): Vector2 end
726 | global function GetMouseDelta(): Vector2 end
727 | global function SetMousePosition(x: cint, y: cint): void end
728 | global function SetMouseOffset(offsetX: cint, offsetY: cint): void end
729 | global function SetMouseScale(scaleX: float32, scaleY: float32): void end
730 | global function GetMouseWheelMove(): float32 end
731 | global function SetMouseCursor(cursor: cint): void end
732 | global function GetTouchX(): cint end
733 | global function GetTouchY(): cint end
734 | global function GetTouchPosition(index: cint): Vector2 end
735 | global function GetTouchPointId(index: cint): cint end
736 | global function GetTouchPointCount(): cint end
737 | global function SetGesturesEnabled(flags: cuint): void end
738 | global function IsGestureDetected(gesture: cint): boolean end
739 | global function GetGestureDetected(): cint end
740 | global function GetGestureHoldDuration(): float32 end
741 | global function GetGestureDragVector(): Vector2 end
742 | global function GetGestureDragAngle(): float32 end
743 | global function GetGesturePinchVector(): Vector2 end
744 | global function GetGesturePinchAngle(): float32 end
745 | global function SetCameraMode(camera: Camera, mode: cint): void end
746 | global function UpdateCamera(camera: *Camera): void end
747 | global function SetCameraPanControl(keyPan: cint): void end
748 | global function SetCameraAltControl(keyAlt: cint): void end
749 | global function SetCameraSmoothZoomControl(keySmoothZoom: cint): void end
750 | global function SetCameraMoveControls(keyFront: cint, keyBack: cint, keyRight: cint, keyLeft: cint, keyUp: cint, keyDown: cint): void end
751 | global function SetShapesTexture(texture: Texture2D, source: Rectangle): void end
752 | global function DrawPixel(posX: cint, posY: cint, color: Color): void end
753 | global function DrawPixelV(position: Vector2, color: Color): void end
754 | global function DrawLine(startPosX: cint, startPosY: cint, endPosX: cint, endPosY: cint, color: Color): void