remove orphan functions from pixelgl (use OpenGL directly instead)
This commit is contained in:
parent
26c44125cf
commit
a3e7656922
|
@ -1,20 +0,0 @@
|
|||
package pixelgl
|
||||
|
||||
import "github.com/go-gl/gl/v3.3-core/gl"
|
||||
|
||||
// This file defines functions that can operate without a parent Doer.
|
||||
|
||||
// Clear clears the current OpenGL context.
|
||||
func Clear(r, g, b, a float32) {
|
||||
DoNoBlock(func() {
|
||||
gl.ClearColor(r, g, b, a)
|
||||
gl.Clear(gl.COLOR_BUFFER_BIT)
|
||||
})
|
||||
}
|
||||
|
||||
// SetViewport sets the OpenGL viewport.
|
||||
func SetViewport(x, y, w, h int32) {
|
||||
DoNoBlock(func() {
|
||||
gl.Viewport(x, y, w, h)
|
||||
})
|
||||
}
|
12
window.go
12
window.go
|
@ -5,6 +5,7 @@ import (
|
|||
"sync"
|
||||
|
||||
"github.com/faiface/pixel/pixelgl"
|
||||
"github.com/go-gl/gl/v3.3-core/gl"
|
||||
"github.com/go-gl/glfw/v3.2/glfw"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
@ -128,7 +129,10 @@ func (w *Window) Delete() {
|
|||
// Clear clears the window with a color.
|
||||
func (w *Window) Clear(c color.Color) {
|
||||
w.Do(func(pixelgl.Context) {
|
||||
pixelgl.Clear(colorToRGBA(c))
|
||||
pixelgl.DoNoBlock(func() {
|
||||
gl.ClearColor(colorToRGBA(c))
|
||||
gl.Clear(gl.COLOR_BUFFER_BIT)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -141,10 +145,10 @@ func (w *Window) Update() {
|
|||
}
|
||||
w.window.SwapBuffers()
|
||||
glfw.PollEvents()
|
||||
})
|
||||
|
||||
w, h := w.window.GetSize()
|
||||
pixelgl.SetViewport(0, 0, int32(w), int32(h))
|
||||
w, h := w.window.GetSize()
|
||||
gl.Viewport(0, 0, int32(w), int32(h))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue