2014-11-03 18:45:50 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
// First, build Skia this way:
|
|
|
|
// ./gyp_skia -Dskia_shared_lib=1 && ninja -C out/Debug
|
2014-10-31 14:11:19 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
#cgo LDFLAGS: -lGL
|
|
|
|
#cgo LDFLAGS: -lGLU
|
2014-11-03 18:45:50 +00:00
|
|
|
#cgo LDFLAGS: -lX11
|
|
|
|
#cgo LDFLAGS: -ldl
|
|
|
|
#cgo LDFLAGS: -lfontconfig
|
|
|
|
#cgo LDFLAGS: -lfreetype
|
|
|
|
#cgo LDFLAGS: -lgif
|
|
|
|
#cgo LDFLAGS: -lm
|
|
|
|
#cgo LDFLAGS: -lpng
|
|
|
|
#cgo LDFLAGS: -lstdc++
|
|
|
|
#cgo LDFLAGS: -lz
|
|
|
|
|
|
|
|
#cgo LDFLAGS: -L ../../out/Debug/lib
|
|
|
|
#cgo LDFLAGS: -Wl,-rpath=../../out/Debug/lib
|
|
|
|
#cgo LDFLAGS: -lskia
|
|
|
|
|
|
|
|
#cgo CFLAGS: -I../../include/c
|
2014-10-31 14:11:19 +00:00
|
|
|
#include "sk_surface.h"
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
2014-11-03 18:45:50 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
p := C.sk_paint_new()
|
|
|
|
defer C.sk_paint_delete(p)
|
|
|
|
fmt.Println("OK!")
|
2014-10-31 14:11:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// TODO: replace this with an idiomatic interface to Skia.
|