This commit is contained in:
2025-04-29 23:46:39 +02:00
parent 4ac8682a15
commit d48b733e66
4 changed files with 667 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
package tinyvg
import "core:bytes"
import "core:io"
Reader :: struct {
using r: bytes.Reader
}
read_data :: #force_inline proc(r: ^Reader, $T: typeid) -> (res: T, err: io.Error) {
b: [size_of(T)]byte
bytes.reader_read(r, b[:]) or_return
return (^T)(&b[0])^, nil
}