aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental/go-skia/skia.go
blob: 30730578a7ac36edbd989be8535b390b11c2449c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package main

// First, build Skia this way:
//   ./gyp_skia -Dskia_shared_lib=1 && ninja -C out/Debug

/*
#cgo LDFLAGS: -lGL
#cgo LDFLAGS: -lGLU
#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
#include "sk_surface.h"
*/
import "C"

import (
	"fmt"
)

func main() {
	p := C.sk_paint_new()
	defer C.sk_paint_delete(p)
	fmt.Println("OK!")
}

// TODO: replace this with an idiomatic interface to Skia.