I'm using http://github.com/ungerik/go-cairo as a cairo library to paint to the screen. I'm completely unfamiliar with this library and cairo in general; however, I've been scouring over documentation for both this library and various cairo bindings for other languages hoping to understand how to paint to screen (unfortunately, I haven't been able to find many tutorials for painting to the screen--only for saving images as .PNGs).
This is what I have so far, and it's not producing any effect (nothing displays). Any help would be appreciated.
package main
import (
"github.com/ungerik/go-cairo"
"time"
)
func main() {
surface := cairo.NewSurface (cairo.FORMAT_ARGB32, 240, 80)
surface.SelectFontFace ("serif", cairo.FONT_SLANT_NORMAL,
cairo.FONT_WEIGHT_BOLD)
surface.SetFontSize(32.0)
surface.SetSourceRGB(0.0, 0.0, 1.0)
surface.MoveTo (10.0, 50.0)
surface.ShowText ("Hello World")
for {
surface.Paint ()
time.Sleep (1000)
}
//surface.Finish()
}