mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
grahics: Reduce gl function calls
This commit is contained in:
parent
388dd835a6
commit
bddd3c9467
@ -150,8 +150,9 @@ func (p *programContext) begin() {
|
|||||||
p.state.lastModelviewMatrix = nil
|
p.state.lastModelviewMatrix = nil
|
||||||
p.state.lastColorMatrix = nil
|
p.state.lastColorMatrix = nil
|
||||||
p.state.lastColorMatrixTranslation = nil
|
p.state.lastColorMatrixTranslation = nil
|
||||||
}
|
|
||||||
c.BindElementArrayBuffer(p.state.indexBufferQuads)
|
c.BindElementArrayBuffer(p.state.indexBufferQuads)
|
||||||
|
c.UniformInt(p.program, "texture", 0)
|
||||||
|
}
|
||||||
|
|
||||||
if !areSameFloat32Array(p.state.lastProjectionMatrix, p.projectionMatrix) {
|
if !areSameFloat32Array(p.state.lastProjectionMatrix, p.projectionMatrix) {
|
||||||
c.UniformFloats(p.program, "projection_matrix", p.projectionMatrix)
|
c.UniformFloats(p.program, "projection_matrix", p.projectionMatrix)
|
||||||
@ -181,8 +182,6 @@ func (p *programContext) begin() {
|
|||||||
copy(p.state.lastModelviewMatrix, modelviewMatrix)
|
copy(p.state.lastModelviewMatrix, modelviewMatrix)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.UniformInt(p.program, "texture", 0)
|
|
||||||
|
|
||||||
e := [4][5]float32{}
|
e := [4][5]float32{}
|
||||||
for i := 0; i < 4; i++ {
|
for i := 0; i < 4; i++ {
|
||||||
for j := 0; j < 5; j++ {
|
for j := 0; j < 5; j++ {
|
||||||
@ -220,5 +219,4 @@ func (p *programContext) begin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *programContext) end() {
|
func (p *programContext) end() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user