Improve GUI on Android, add OpenAsset function

This commit is contained in:
Milan Nikolic 2017-02-02 02:05:14 +01:00
parent 8fc94a8d3d
commit 56debbf236
7 changed files with 181 additions and 109 deletions

View file

@ -7,7 +7,12 @@ package raylib
#include <stdlib.h>
*/
import "C"
import "unsafe"
import (
"io"
"os"
"unsafe"
)
// Initialize Window and OpenGL Graphics
func InitWindow(width int32, height int32, title string) {
@ -70,3 +75,12 @@ func GetDroppedFiles(count *int32) []string {
func ClearDroppedFiles() {
C.ClearDroppedFiles()
}
// Open asset
func OpenAsset(name string) (io.ReadCloser, error) {
f, err := os.Open(name)
if err != nil {
return nil, err
}
return f, nil
}