mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/graphics: rename constants
This commit is contained in:
parent
98e2d86ea3
commit
35a5c88901
@ -31,8 +31,8 @@ const (
|
|||||||
1 + // the texture source region's origin
|
1 + // the texture source region's origin
|
||||||
1 // the texture source region's size
|
1 // the texture source region's size
|
||||||
|
|
||||||
DestinationTextureSizeUniformVariableIndex = 0
|
TextureDestinationSizeUniformVariableIndex = 0
|
||||||
TextureSizesUniformVariableIndex = 1
|
TextureSourceSizesUniformVariableIndex = 1
|
||||||
TextureDestinationRegionOriginUniformVariableIndex = 2
|
TextureDestinationRegionOriginUniformVariableIndex = 2
|
||||||
TextureDestinationRegionSizeUniformVariableIndex = 3
|
TextureDestinationRegionSizeUniformVariableIndex = 3
|
||||||
TextureSourceOffsetsUniformVariableIndex = 4
|
TextureSourceOffsetsUniformVariableIndex = 4
|
||||||
|
@ -963,7 +963,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics.
|
|||||||
|
|
||||||
// Set the destination texture size.
|
// Set the destination texture size.
|
||||||
dw, dh := dst.internalSize()
|
dw, dh := dst.internalSize()
|
||||||
uniformVars[graphics.DestinationTextureSizeUniformVariableIndex] = graphicsdriver.Uniform{
|
uniformVars[graphics.TextureDestinationSizeUniformVariableIndex] = graphicsdriver.Uniform{
|
||||||
Float32s: []float32{float32(dw), float32(dh)},
|
Float32s: []float32{float32(dw), float32(dh)},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -976,7 +976,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics.
|
|||||||
usizes[2*i+1] = float32(h)
|
usizes[2*i+1] = float32(h)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
uniformVars[graphics.TextureSizesUniformVariableIndex] = graphicsdriver.Uniform{
|
uniformVars[graphics.TextureSourceSizesUniformVariableIndex] = graphicsdriver.Uniform{
|
||||||
Float32s: usizes,
|
Float32s: usizes,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics.
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const idx = graphics.DestinationTextureSizeUniformVariableIndex
|
const idx = graphics.TextureDestinationSizeUniformVariableIndex
|
||||||
w, h := destination.framebufferSize()
|
w, h := destination.framebufferSize()
|
||||||
g.uniformVars[idx].name = g.uniformVariableName(idx)
|
g.uniformVars[idx].name = g.uniformVariableName(idx)
|
||||||
g.uniformVars[idx].value.Float32s = []float32{float32(w), float32(h)}
|
g.uniformVars[idx].value.Float32s = []float32{float32(w), float32(h)}
|
||||||
@ -284,7 +284,7 @@ func (g *Graphics) DrawTriangles(dstID graphicsdriver.ImageID, srcIDs [graphics.
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const idx = graphics.TextureSizesUniformVariableIndex
|
const idx = graphics.TextureSourceSizesUniformVariableIndex
|
||||||
g.uniformVars[idx].name = g.uniformVariableName(idx)
|
g.uniformVars[idx].name = g.uniformVariableName(idx)
|
||||||
g.uniformVars[idx].value.Float32s = sizes
|
g.uniformVars[idx].value.Float32s = sizes
|
||||||
g.uniformVars[idx].typ = shader.ir.Uniforms[idx]
|
g.uniformVars[idx].typ = shader.ir.Uniforms[idx]
|
||||||
|
Loading…
Reference in New Issue
Block a user