quick corrections to previous commit
This commit is contained in:
parent
18bc12367b
commit
e0c26f1caa
|
@ -288,6 +288,13 @@ func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) {
|
||||||
float32(dstBounds.W()),
|
float32(dstBounds.W()),
|
||||||
float32(dstBounds.H()),
|
float32(dstBounds.H()),
|
||||||
}
|
}
|
||||||
|
bx, by, bw, bh := intBounds(bounds)
|
||||||
|
ct.dst.shader.uniformDefaults.texbounds = mgl32.Vec4{
|
||||||
|
float32(bx),
|
||||||
|
float32(by),
|
||||||
|
float32(bw),
|
||||||
|
float32(bh),
|
||||||
|
}
|
||||||
|
|
||||||
for loc, u := range ct.dst.shader.uniforms {
|
for loc, u := range ct.dst.shader.uniforms {
|
||||||
ct.dst.shader.s.SetUniformAttr(loc, u.Value)
|
ct.dst.shader.s.SetUniformAttr(loc, u.Value)
|
||||||
|
@ -300,14 +307,6 @@ func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) {
|
||||||
} else {
|
} else {
|
||||||
tex.Begin()
|
tex.Begin()
|
||||||
|
|
||||||
bx, by, bw, bh := intBounds(bounds)
|
|
||||||
shader.SetUniformAttr(canvasTexBounds, &mgl32.Vec4{
|
|
||||||
float32(bx),
|
|
||||||
float32(by),
|
|
||||||
float32(bw),
|
|
||||||
float32(bh),
|
|
||||||
})
|
|
||||||
|
|
||||||
if tex.Smooth() != smt {
|
if tex.Smooth() != smt {
|
||||||
tex.SetSmooth(smt)
|
tex.SetSmooth(smt)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
package pixelgl
|
package pixelgl
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
"github.com/faiface/glhf"
|
"github.com/faiface/glhf"
|
||||||
"github.com/faiface/mainthread"
|
"github.com/faiface/mainthread"
|
||||||
"github.com/faiface/pixel"
|
"github.com/faiface/pixel"
|
||||||
|
@ -67,7 +65,6 @@ func (gs *GLShader) GetUniform(Name string) int {
|
||||||
}
|
}
|
||||||
func (gs *GLShader) AddUniform(Name string, Value interface{}) {
|
func (gs *GLShader) AddUniform(Name string, Value interface{}) {
|
||||||
Type := getUniformType(Value)
|
Type := getUniformType(Value)
|
||||||
fmt.Println(Type)
|
|
||||||
if loc := gs.GetUniform(Name); loc > -1 {
|
if loc := gs.GetUniform(Name); loc > -1 {
|
||||||
gs.uniforms[loc].Name = Name
|
gs.uniforms[loc].Name = Name
|
||||||
gs.uniforms[loc].Type = Type
|
gs.uniforms[loc].Type = Type
|
||||||
|
|
Loading…
Reference in New Issue