Page 1 of 1

OpenVG and Go Programming Language

Posted: Tue Sep 04, 2012 11:00 am
by ajstarks
The OpenVG library at http://github.com/ajstarks/openvg now supports using OpenVG with the Go programming language. Here is the "hello, world" OpenVG program in Go:

Code: Select all

// first OpenVG program
package main

import (
	"bufio"
	"github.com/ajstarks/openvg"
	"os"
)

func main() {
	width, height := openvg.Init() // OpenGL, etc initialization

	w2 := float64(width / 2)
	h2 := float64(height / 2)
	w := float64(width)

	openvg.Start(width, height)                               // Start the picture
	openvg.Background(0, 0, 0)                                // Black background
	openvg.Fill(44, 77, 232, 1)                               // Big blue marble
	openvg.Circle(w2, 0, w)                                   // The "world"
	openvg.Fill(255, 255, 255, 1)                             // White text
	openvg.TextMid(w2, h2, "hello, world", "serif", width/10) // Greetings 
	openvg.End()                                              // End the picture
	bufio.NewReader(os.Stdin).ReadLine()                      // Pause until [RETURN]
	openvg.Finish()                                           // Graphics cleanup
}

Re: OpenVG and Go Programming Language

Posted: Sat Apr 13, 2013 3:40 pm
by Thaddy
I have Freepascal 2.7.1 bindings for your openvg library available. Incl demo. Would you like to have them in your repository or shall I create a link to one of my servers?

Thaddy

Re: OpenVG and Go Programming Language

Posted: Sat Apr 13, 2013 4:37 pm
by ajstarks
sounds interesting. Do you have a link to your code?

Re: OpenVG and Go Programming Language

Posted: Sat Apr 13, 2013 5:10 pm
by Thaddy
Not yet, but I can send it to you for review. It does everything you say it does.
I am preparing build instructions and a make script, because it takes a little knowledge otherwise.
After that, it works as you meant it to work ;)

Re: OpenVG and Go Programming Language

Posted: Sun Apr 14, 2013 4:37 pm
by Thaddy
Hi,

About the Freepascal headers:
You can download a release candidate with build instructions from http://thaddy.com/shapesfpc.zip
Docs are in shapes.pp (use) and in readme.fpc (build).

This is a temporary location.

Have fun

Thaddy