mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
vlib: sdl module + tVintris example
This commit is contained in:

committed by
Alexander Medvednikov

parent
6dd1270539
commit
9d854c5df0
29
vlib/sdl/image/image.v
Normal file
29
vlib/sdl/image/image.v
Normal file
@ -0,0 +1,29 @@
|
||||
module image
|
||||
|
||||
#flag linux -lSDL2_image
|
||||
#include <SDL_image.h>
|
||||
|
||||
// following kludge until `sdl2-config ...` is supported also on windows
|
||||
#flag windows -I/msys64/mingw64/include/SDL2
|
||||
#flag windows -L/mingw64/lib -lSDL2_image
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
// SDL_Image.h
|
||||
//////////////////////////////////////////////////////////
|
||||
//fn C.IMG_Load_RW(logo &vsdl2.RwOps, free_src int) &vsdl2.Surface
|
||||
fn C.IMG_Init(flags int) int
|
||||
fn C.IMG_Quit()
|
||||
fn C.IMG_Load(file byteptr) voidptr
|
||||
|
||||
pub fn img_init(flags int) int {
|
||||
return C.IMG_Init(flags)
|
||||
}
|
||||
|
||||
pub fn quit() {
|
||||
C.IMG_Quit()
|
||||
}
|
||||
|
||||
pub fn load(file string) &vsdl2.Surface {
|
||||
res := C.IMG_Load(file.str)
|
||||
return res
|
||||
}
|
Reference in New Issue
Block a user