Well, you need a Go draw package in place of the C library. There is a draw package in github.com/9fans/go/ but unfortunately I think it only supports plan9port devdraw, rather than the native Plan 9 draw device. So there is some library work to be done first. Since the Go standard library also contains the most important drawing primitives implemented by the Plan 9 draw device (with the exception of font rendering, but there is golang.org/x/image/font), you may be able to ignore a lot of functionality provided by the Plan 9 draw library and focus on a few things like loading pixel data directly to the draw device.
See: http://man.cat-v.org/plan_9/3/draw Jeremy On Sat, 4 Apr 2020 at 06:55, Kim Lassila <[email protected]> wrote: > > Has anyone written a graphical application in Go on Plan 9? How would the Go > equivalent of black.c (thank you fgb) look like? > > - - - clip - - - > > #include <u.h> > #include <libc.h> > #include <draw.h> > > void > main(int, char *argv[]) > { > Rectangle rect; > Image *black; > > fmtinstall('R', Rfmt); > if(initdraw(nil, nil, argv[0]) < 0) > sysfatal("initdraw: %r"); > rect = screen->r; > black = display->black; > draw(screen, rect, black, nil, ZP); > flushimage(display, 1); > sleep(5 * 1000); > closedisplay(display); > print("rectangle was %R\n", rect); > exits(nil); > } > > 9fans / 9fans / see discussions + participants + delivery options Permalink ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T0d490c91935dc74b-M08178595d1453fd46812690c Delivery options: https://9fans.topicbox.com/groups/9fans/subscription
