Rebased.
This commit is contained in:
1 parent
3a9b86628a
commit
678fdae966
5 files changed
+1382
-71
No files matched your search
@@ -0,0 +1,19 @@
|
||||
//+build !js
|
||||
package core_image_bmp
|
||||
|
||||
import "core:os"
|
||||
|
||||
load :: proc{load_from_file, load_from_bytes, load_from_context}
|
||||
|
||||
load_from_file :: proc(filename: string, options := Options{}, allocator := context.allocator) -> (img: ^Image, err: Error) {
|
||||
context.allocator = allocator
|
||||
|
||||
data, ok := os.read_entire_file(filename)
|
||||
defer delete(data)
|
||||
|
||||
if ok {
|
||||
return load_from_bytes(data, options)
|
||||
} else {
|
||||
return nil, .Unable_To_Read_File
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user