mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: refactoring
This commit is contained in:
parent
77f765d483
commit
99f8e335ee
@ -22,7 +22,3 @@ func init() {
|
|||||||
// TODO: Should graphics() be moved to the graphicscommand package?
|
// TODO: Should graphics() be moved to the graphicscommand package?
|
||||||
graphicscommand.SetGraphicsDriver(graphics())
|
graphicscommand.SetGraphicsDriver(graphics())
|
||||||
}
|
}
|
||||||
|
|
||||||
func NeedsInvertY() bool {
|
|
||||||
return graphicscommand.NeedsInvertY()
|
|
||||||
}
|
|
||||||
|
@ -22,11 +22,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/hajimehoshi/ebiten/v2/internal/graphics"
|
"github.com/hajimehoshi/ebiten/v2/internal/graphics"
|
||||||
|
"github.com/hajimehoshi/ebiten/v2/internal/graphicscommand"
|
||||||
"github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver"
|
"github.com/hajimehoshi/ebiten/v2/internal/graphicsdriver"
|
||||||
"github.com/hajimehoshi/ebiten/v2/internal/mipmap"
|
"github.com/hajimehoshi/ebiten/v2/internal/mipmap"
|
||||||
"github.com/hajimehoshi/ebiten/v2/internal/shader"
|
"github.com/hajimehoshi/ebiten/v2/internal/shader"
|
||||||
"github.com/hajimehoshi/ebiten/v2/internal/shaderir"
|
"github.com/hajimehoshi/ebiten/v2/internal/shaderir"
|
||||||
"github.com/hajimehoshi/ebiten/v2/internal/ui"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var shaderSuffix string
|
var shaderSuffix string
|
||||||
@ -126,7 +126,7 @@ func NewShader(src []byte) (*Shader, error) {
|
|||||||
var buf bytes.Buffer
|
var buf bytes.Buffer
|
||||||
buf.Write(src)
|
buf.Write(src)
|
||||||
buf.WriteString(shaderSuffix)
|
buf.WriteString(shaderSuffix)
|
||||||
if ui.NeedsInvertY() {
|
if graphicscommand.NeedsInvertY() {
|
||||||
buf.WriteString(`
|
buf.WriteString(`
|
||||||
func __vertex(position vec2, texCoord vec2, color vec4) (vec4, vec2, vec4) {
|
func __vertex(position vec2, texCoord vec2, color vec4) (vec4, vec2, vec4) {
|
||||||
return mat4(
|
return mat4(
|
||||||
|
Loading…
Reference in New Issue
Block a user