quick corrections to previous commit

This commit is contained in:
Brandon 2018-06-18 00:54:49 -06:00
parent 18bc12367b
commit e0c26f1caa
2 changed files with 7 additions and 11 deletions

View File

@ -288,6 +288,13 @@ func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) {
float32(dstBounds.W()),
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 {
ct.dst.shader.s.SetUniformAttr(loc, u.Value)
@ -300,14 +307,6 @@ func (ct *canvasTriangles) draw(tex *glhf.Texture, bounds pixel.Rect) {
} else {
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 {
tex.SetSmooth(smt)
}

View File

@ -1,8 +1,6 @@
package pixelgl
import (
"fmt"
"github.com/faiface/glhf"
"github.com/faiface/mainthread"
"github.com/faiface/pixel"
@ -67,7 +65,6 @@ func (gs *GLShader) GetUniform(Name string) int {
}
func (gs *GLShader) AddUniform(Name string, Value interface{}) {
Type := getUniformType(Value)
fmt.Println(Type)
if loc := gs.GetUniform(Name); loc > -1 {
gs.uniforms[loc].Name = Name
gs.uniforms[loc].Type = Type