LoadImageAnimFromMemory function added
This commit is contained in:
parent
77b59b8ebe
commit
4da4ec54eb
2 changed files with 21 additions and 0 deletions
|
@ -113,6 +113,18 @@ func LoadImageAnim(fileName string, frames *int32) *Image {
|
|||
return v
|
||||
}
|
||||
|
||||
// LoadImageAnimFromMemory - Load image sequence from memory buffer
|
||||
func LoadImageAnimFromMemory(fileType string, fileData []byte, dataSize int32, frames []int32) *Image {
|
||||
cfileType := C.CString(fileType)
|
||||
defer C.free(unsafe.Pointer(cfileType))
|
||||
cfileData := (*C.uchar)(unsafe.Pointer(&fileData[0]))
|
||||
cdataSize := (C.int)(dataSize)
|
||||
cframes := (*C.int)(unsafe.Pointer(&frames[0]))
|
||||
ret := C.LoadImageAnimFromMemory(cfileType, cfileData, cdataSize, cframes)
|
||||
v := newImageFromPointer(unsafe.Pointer(&ret))
|
||||
return v
|
||||
}
|
||||
|
||||
// LoadImageFromMemory - Load image from memory buffer, fileType refers to extension: i.e. ".png"
|
||||
func LoadImageFromMemory(fileType string, fileData []byte, dataSize int32) *Image {
|
||||
cfileType := C.CString(fileType)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue