Fork of https://github.com/tfriedel6/canvas to remove the cgo part, only leaving software rendering
Find a file
2018-04-19 17:02:28 +02:00
goglimpl a go-gl implementation of the gl interface 2018-01-24 14:20:12 +01:00
sdlcanvas also close window on quit event 2018-04-14 11:21:37 +02:00
.gitignore split main loop for manual main loop support 2018-03-24 19:20:30 +01:00
canvas.go implemented textAlign; unknown characters now act like a space 2018-04-19 17:02:28 +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 don't draw text that is outside the screen bounds 2018-04-14 11:59:09 +02: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 implemented globalAlpha 2018-04-09 17:39:26 +02:00
images.go implemented globalAlpha 2018-04-09 17:39:26 +02:00
LICENSE added BSD license 2018-03-28 11:33:15 +02:00
made_shaders.go implemented globalAlpha 2018-04-09 17:39:26 +02: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 clipping with the rect function now uses scissor test instead of stencil 2018-04-04 17:10:36 +02:00
paths.go added documentation 2018-04-11 17:40:39 +02:00
README.md Update README.md 2018-03-27 16:16:25 +02:00
shaders.go implemented globalAlpha 2018-04-09 17:39:26 +02:00
text.go implemented textAlign; unknown characters now act like a space 2018-04-19 17:02:28 +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.