simplify NewWindow
This commit is contained in:
parent
33fb585acc
commit
0da605c366
10
window.go
10
window.go
|
@ -126,7 +126,7 @@ func NewWindow(config WindowConfig) (*Window, error) {
|
||||||
|
|
||||||
pixelgl.Do(func() {
|
pixelgl.Do(func() {
|
||||||
w.begin()
|
w.begin()
|
||||||
defer w.end()
|
w.end()
|
||||||
|
|
||||||
w.shader, err = pixelgl.NewShader(
|
w.shader, err = pixelgl.NewShader(
|
||||||
defaultVertexFormat,
|
defaultVertexFormat,
|
||||||
|
@ -137,14 +137,6 @@ func NewWindow(config WindowConfig) (*Window, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(errors.Wrap(err, "NewWindow: failed to create shader"))
|
panic(errors.Wrap(err, "NewWindow: failed to create shader"))
|
||||||
}
|
}
|
||||||
|
|
||||||
// default uniforms
|
|
||||||
w.shader.Begin()
|
|
||||||
w.shader.SetUniformAttr(maskColorVec4, mgl32.Vec4{1, 1, 1, 1})
|
|
||||||
w.shader.SetUniformAttr(transformMat3, mgl32.Ident3())
|
|
||||||
|
|
||||||
// this is tricky, w.shader.End() is not needed here, because it will
|
|
||||||
// actually be ended by a deferred w.End() call
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.Destroy()
|
w.Destroy()
|
||||||
|
|
Loading…
Reference in New Issue