func drawPrep() { gl.Disable(gl.DEPTH_TEST) gl.Disable(gl.TEXTURE_2D) gl.PolygonMode(gl.FRONT_AND_BACK, gl.FILL) gl.Enable(gl.BLEND) gl.BlendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA) gl.ClearStencil(0) gl.Clear(gl.STENCIL_BUFFER_BIT) }
func (g *Gui) Draw() { gl.MatrixMode(gl.PROJECTION) gl.LoadIdentity() region := g.root.Render_region gl.Ortho(float64(region.X), float64(region.X+region.Dx), float64(region.Y), float64(region.Y+region.Dy), 1000, -1000) gl.ClearColor(0, 0, 0, 1) gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT) gl.MatrixMode(gl.MODELVIEW) gl.LoadIdentity() g.root.Draw(region) if g.FocusWidget() != nil { g.FocusWidget().DrawFocused(region) } }