renamed the backend directories so they match the package names
This commit is contained in:
parent
623a4742ce
commit
bbcb712b73
35 changed files with 27 additions and 27 deletions
|
@ -3,7 +3,7 @@ package goglbackend
|
||||||
import (
|
import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/gogl/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *GoGLBackend) ClearClip() {
|
func (b *GoGLBackend) ClearClip() {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *GoGLBackend) Clear(pts [4][2]float64) {
|
func (b *GoGLBackend) Clear(pts [4][2]float64) {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
const alphaTexSize = 2048
|
const alphaTexSize = 2048
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LinearGradient is a gradient with any number of
|
// LinearGradient is a gradient with any number of
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"image/color"
|
"image/color"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/gogl/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetImageData returns an RGBA image of the current image
|
// GetImageData returns an RGBA image of the current image
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Image represents a loaded image that can be used in various drawing functions
|
// Image represents a loaded image that can be used in various drawing functions
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"unicode"
|
"unicode"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/gogl/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
type shaderProgram struct {
|
type shaderProgram struct {
|
|
@ -3,7 +3,7 @@ package xmobilebackend
|
||||||
import (
|
import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"golang.org/x/mobile/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *XMobileBackend) ClearClip() {
|
func (b *XMobileBackend) ClearClip() {
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"golang.org/x/mobile/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (b *XMobileBackend) Clear(pts [4][2]float64) {
|
func (b *XMobileBackend) Clear(pts [4][2]float64) {
|
|
@ -18,8 +18,8 @@ func main() {
|
||||||
}
|
}
|
||||||
d1 := filepath.Base(dir)
|
d1 := filepath.Base(dir)
|
||||||
d2 := filepath.Base(filepath.Dir(dir))
|
d2 := filepath.Base(filepath.Dir(dir))
|
||||||
if d2 != "backend" || d1 != "xmobile" {
|
if d2 != "backend" || d1 != "xmobilebackend" {
|
||||||
log.Fatalln("This must be run in the backend/xmobile directory")
|
log.Fatalln("This must be run in the backend/xmobilebackend directory")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,16 +41,16 @@ func main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
{ // copy gogl files
|
{ // copy gogl files
|
||||||
fis, err := ioutil.ReadDir("../gogl")
|
fis, err := ioutil.ReadDir("../goglbackend")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to read dir ../gogl: %v", err)
|
log.Fatalf("Failed to read dir ../goglbackend: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, fi := range fis {
|
for _, fi := range fis {
|
||||||
if !strings.HasSuffix(fi.Name(), ".go") || fi.Name() == "shader.go" {
|
if !strings.HasSuffix(fi.Name(), ".go") || fi.Name() == "shader.go" {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
path := filepath.Join("../gogl", fi.Name())
|
path := filepath.Join("../goglbackend", fi.Name())
|
||||||
data, err := ioutil.ReadFile(path)
|
data, err := ioutil.ReadFile(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to read file %s: %v", path, err)
|
log.Fatalf("Failed to read file %s: %v", path, err)
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"golang.org/x/mobile/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// LinearGradient is a gradient with any number of
|
// LinearGradient is a gradient with any number of
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"image/color"
|
"image/color"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"golang.org/x/mobile/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetImageData returns an RGBA image of the current image
|
// GetImageData returns an RGBA image of the current image
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"golang.org/x/mobile/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Image represents a loaded image that can be used in various drawing functions
|
// Image represents a loaded image that can be used in various drawing functions
|
|
@ -246,7 +246,7 @@ void main() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
float o = max(o1, o2);
|
float o = max(o1, o2);
|
||||||
float r = radFrom + o * (radTo - radFrom);
|
//float r = radFrom + o * (radTo - radFrom);
|
||||||
vec4 col = texture2D(gradient, vec2(o, 0.0));
|
vec4 col = texture2D(gradient, vec2(o, 0.0));
|
||||||
col.a *= texture2D(alphaTex, v_atc).a * globalAlpha;
|
col.a *= texture2D(alphaTex, v_atc).a * globalAlpha;
|
||||||
gl_FragColor = col;
|
gl_FragColor = col;
|
|
@ -8,7 +8,7 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas/backend/backendbase"
|
"github.com/tfriedel6/canvas/backend/backendbase"
|
||||||
"golang.org/x/mobile/gl"
|
"github.com/tfriedel6/canvas/backend/goglbackend/gl"
|
||||||
)
|
)
|
||||||
|
|
||||||
const alphaTexSize = 2048
|
const alphaTexSize = 2048
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl"
|
"github.com/tfriedel6/canvas/backend/goglbackend"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cv *canvas.Canvas
|
var cv *canvas.Canvas
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
"github.com/go-gl/gl/v3.2-core/gl"
|
"github.com/go-gl/gl/v3.2-core/gl"
|
||||||
"github.com/go-gl/glfw/v3.2/glfw"
|
"github.com/go-gl/glfw/v3.2/glfw"
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl"
|
"github.com/tfriedel6/canvas/backend/goglbackend"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -6,7 +6,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/xmobile"
|
"github.com/tfriedel6/canvas/backend/xmobilebackend"
|
||||||
"golang.org/x/mobile/app"
|
"golang.org/x/mobile/app"
|
||||||
"golang.org/x/mobile/event/lifecycle"
|
"golang.org/x/mobile/event/lifecycle"
|
||||||
"golang.org/x/mobile/event/paint"
|
"golang.org/x/mobile/event/paint"
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl"
|
"github.com/tfriedel6/canvas/backend/goglbackend"
|
||||||
)
|
)
|
||||||
|
|
||||||
var cv *canvas.Canvas
|
var cv *canvas.Canvas
|
||||||
|
|
|
@ -7,7 +7,7 @@ import (
|
||||||
|
|
||||||
"github.com/go-gl/gl/v3.2-core/gl"
|
"github.com/go-gl/gl/v3.2-core/gl"
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl"
|
"github.com/tfriedel6/canvas/backend/goglbackend"
|
||||||
"github.com/veandco/go-sdl2/sdl"
|
"github.com/veandco/go-sdl2/sdl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
|
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/xmobile"
|
"github.com/tfriedel6/canvas/backend/xmobilebackend"
|
||||||
"golang.org/x/exp/shiny/driver/gldriver"
|
"golang.org/x/exp/shiny/driver/gldriver"
|
||||||
"golang.org/x/exp/shiny/screen"
|
"golang.org/x/exp/shiny/screen"
|
||||||
"golang.org/x/exp/shiny/widget"
|
"golang.org/x/exp/shiny/widget"
|
||||||
|
|
|
@ -12,7 +12,7 @@ import (
|
||||||
"github.com/go-gl/gl/v3.2-core/gl"
|
"github.com/go-gl/gl/v3.2-core/gl"
|
||||||
"github.com/go-gl/glfw/v3.2/glfw"
|
"github.com/go-gl/glfw/v3.2/glfw"
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl"
|
"github.com/tfriedel6/canvas/backend/goglbackend"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Window represents the opened window with GL context. The Mouse* and Key*
|
// Window represents the opened window with GL context. The Mouse* and Key*
|
||||||
|
|
|
@ -11,7 +11,7 @@ import (
|
||||||
|
|
||||||
"github.com/go-gl/gl/v3.2-core/gl"
|
"github.com/go-gl/gl/v3.2-core/gl"
|
||||||
"github.com/tfriedel6/canvas"
|
"github.com/tfriedel6/canvas"
|
||||||
"github.com/tfriedel6/canvas/backend/gogl"
|
"github.com/tfriedel6/canvas/backend/goglbackend"
|
||||||
"github.com/veandco/go-sdl2/sdl"
|
"github.com/veandco/go-sdl2/sdl"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue