Fork of https://github.com/tfriedel6/canvas to remove the cgo part, only leaving software rendering
Find a file
2018-04-04 16:15:39 +02:00
goglimpl a go-gl implementation of the gl interface 2018-01-24 14:20:12 +01:00
sdlcanvas fallback to no msaa 2018-03-28 18:58:07 +02:00
.gitignore split main loop for manual main loop support 2018-03-24 19:20:30 +01:00
canvas.go deduplicated some code 2018-03-27 16:03:02 +02:00
color.go switched from float32 to float64 for better compatibility with the default go math package; moved vector and matrix code into package 2018-03-21 12:45:32 +01:00
freetype.go moved a freetype source file into the project and optimized it for the given purpose, only upload rendered text rectangle to the texture 2018-01-29 13:14:42 +01:00
gradients.go switched from float32 to float64 for better compatibility with the default go math package; moved vector and matrix code into package 2018-03-21 12:45:32 +01:00
imagedata.go more documentation; renamed W/H to Width/Height on Image type 2018-03-27 15:57:01 +02:00
images.go deduplicated some code 2018-03-27 16:03:02 +02:00
LICENSE added BSD license 2018-03-28 11:33:15 +02:00
made_shaders.go shaders are now in their own file; text fill now uses font rendering more directly and supports fill styles 2018-02-26 15:40:48 +01:00
make_shaders.go shaders are now in their own file; text fill now uses font rendering more directly and supports fill styles 2018-02-26 15:40:48 +01:00
math.go switched from float32 to float64 for better compatibility with the default go math package; moved vector and matrix code into package 2018-03-21 12:45:32 +01:00
openglinterface.go more documentation; renamed W/H to Width/Height on Image type 2018-03-27 15:57:01 +02:00
paths.go added StrokeRect function 2018-04-04 16:15:39 +02:00
README.md Update README.md 2018-03-27 16:16:25 +02:00
shaders.go shaders are now in their own file; text fill now uses font rendering more directly and supports fill styles 2018-02-26 15:40:48 +01:00
text.go added MeasureText method 2018-03-28 12:42:50 +02:00
triangulation.go paths with sub-paths fixed 2018-04-04 16:01:11 +02:00

Go canvas

Canvas is a Go library based on OpenGL that tries to provide the HTML5 canvas API as closely as possible.

Many of the basic functions are supported, but it is still a work in progress. The library aims to accept a lot of different parameters on each function in a similar way as the Javascript API does.

Since the library uses OpenGL directly in many places, the performance is likely to be decent, but not great. Browser implementation are likely to be much more optimized, but this is certainly useable.

GoDoc is available here

sdlcanvas

The sdlcanvas subpackage provides a very simple way to get started with just a few lines of code. As the name implies it is based on the SDL library. It creates a window for you and gives you a canvas to draw with. It also serves as a useful example for more complex programs.