Files
corelang/modules/Multimedia.core
2026-03-20 08:35:18 +01:00

65 lines
1.3 KiB
Core

/*
Library for making games/graphical applications
* The api is very simple, very few function calls
* You retrieve information about the state of application from "Mu" struct
* Data is available in many different formats to avoid format conversions in user code
API and name inspired by one of Per Vognsen streams
https://www.youtube.com/watch?v=NG_mUhc8LRw&list=PLU94OURih-CjrtFuazwZ5GYzTrupOMDL7&index=19
All of his channel is recommended watch for programmers.
*/
Mu: MU
MU :: struct
screen: *U32
window: MUWindow
key: [Key.Count]KeyState
mouse: Mouse
frame_count: U64
time: MUTime
quit: bool
frame_arena: Arena
os: Platform
MUWindow :: struct
x: int
y: int
sizef: Vec2
size: Vec2I
resizable: bool
MUTime :: struct
total : F64
delta : F64 // @modifiable
start : F64
frame_start: F64
KeyState :: struct
down: bool
Key :: enum
None
Up;Down;Left;Right;Escape;Control;Backspace;Alt;Shift;Tab
F1;F2;F3;F4;F5;F6;F7;F8;F9;F10
F11;F12;A;B;C;D;E;F;G;H
I;J;K;L;M;N;O;P;Q;R
S;T;U;V;W;X;Y;Z;K0;K1
K2;K3;K4;K5;K6;K7;K8;K9
Count
Mouse :: struct
left: KeyState
right: KeyState
middle: KeyState
wheel: int
#import "Base.core"
#import "MathF32.core"
#import "MathVec2.core"
#import "Arena.core"
#load "$os_multimedia.core"