x-backend #2

Merged
sashakoshka merged 34 commits from x-backend into main 2022-11-14 21:40:25 -07:00
Showing only changes of commit 01f43a03a4 - Show all commits

View File

@ -74,6 +74,11 @@ func (backend *Backend) calculateWindowSize () (x, y int) {
return
}
func (backend *Backend) bindCanvas () {
backend.canvas.XSurfaceSet(backend.window.Id)
backend.canvas.XDraw()
backend.canvas.XPaint(backend.window.Id)
}
// factory instantiates an X backend.
func factory (application *stone.Application) (output stone.Backend, err error) {
@ -106,6 +111,15 @@ func factory (application *stone.Application) (output stone.Backend, err error)
0)
backend.window.Map()
// create a canvas
backend.canvas = xgraphics.New (
backend.connection,
image.Rect (
0, 0,
windowWidth,
windowHeight))
backend.bindCanvas()
// attatch graceful close handler
backend.window.WMGracefulClose (func (window *xwindow.Window) {
backend.window.Destroy()