mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
Fix the module paths (#12)
This commit is contained in:
parent
69a3dfed40
commit
a32973a33e
@ -1,8 +1,8 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Field struct {
|
type Field struct {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
"image/color"
|
"image/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/ui"
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
_ "image/png"
|
_ "image/png"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
"github.com/hajimehoshi/go-ebiten/ui"
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
"image/color"
|
"image/color"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
"time"
|
"time"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/ui"
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Input struct {
|
type Input struct {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
package blocks
|
package blocks
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
"github.com/hajimehoshi/go-ebiten/ui"
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
"image/color"
|
"image/color"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/example/blocks"
|
"github.com/hajimehoshi/ebiten/example/blocks"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/ui"
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
"github.com/hajimehoshi/go-ebiten/ui/cocoa"
|
"github.com/hajimehoshi/ebiten/ui/dummy"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime"
|
"runtime"
|
||||||
@ -29,10 +29,10 @@ func main() {
|
|||||||
const frameTime = time.Duration(int64(time.Second) / int64(fps))
|
const frameTime = time.Duration(int64(time.Second) / int64(fps))
|
||||||
const title = "Ebiten Demo"
|
const title = "Ebiten Demo"
|
||||||
|
|
||||||
u := cocoa.UI()
|
u := new(dummy.UI)
|
||||||
canvas := u.CreateCanvas(screenWidth, screenHeight, screenScale, title)
|
canvas := u.CreateCanvas(screenWidth, screenHeight, screenScale, title)
|
||||||
|
|
||||||
textureFactory := cocoa.TextureFactory()
|
textureFactory := new(dummy.TextureFactory)
|
||||||
var game Game = blocks.NewGame(NewTextures(textureFactory))
|
var game Game = blocks.NewGame(NewTextures(textureFactory))
|
||||||
tick := time.Tick(frameTime)
|
tick := time.Tick(frameTime)
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/example/blocks"
|
"github.com/hajimehoshi/ebiten/example/blocks"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"image"
|
"image"
|
||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package graphics
|
package graphics
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Rect struct {
|
type Rect struct {
|
||||||
|
@ -6,8 +6,8 @@ package opengl
|
|||||||
// #include <OpenGL/gl.h>
|
// #include <OpenGL/gl.h>
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
)
|
)
|
||||||
|
|
||||||
func enableAlphaBlending() {
|
func enableAlphaBlending() {
|
||||||
|
@ -5,9 +5,9 @@ package opengl
|
|||||||
// #include <OpenGL/gl.h>
|
// #include <OpenGL/gl.h>
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/opengl/shader"
|
"github.com/hajimehoshi/ebiten/graphics/opengl/shader"
|
||||||
"image"
|
"image"
|
||||||
"math"
|
"math"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -6,7 +6,7 @@ package opengl
|
|||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
)
|
)
|
||||||
|
|
||||||
type RenderTarget struct {
|
type RenderTarget struct {
|
||||||
|
@ -6,8 +6,8 @@ package shader
|
|||||||
// #include <stdlib.h>
|
// #include <stdlib.h>
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
"sync"
|
"sync"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
@ -6,7 +6,7 @@ package shader
|
|||||||
// #include <stdlib.h>
|
// #include <stdlib.h>
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
"github.com/hajimehoshi/ebiten/graphics/matrix"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ package opengl
|
|||||||
// #include <OpenGL/gl.h>
|
// #include <OpenGL/gl.h>
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"image"
|
"image"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
@ -17,9 +17,9 @@ package cocoa
|
|||||||
//
|
//
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/opengl"
|
"github.com/hajimehoshi/ebiten/graphics/opengl"
|
||||||
"github.com/hajimehoshi/go-ebiten/ui"
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -8,8 +8,8 @@ package cocoa
|
|||||||
//
|
//
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics/opengl"
|
"github.com/hajimehoshi/ebiten/graphics/opengl"
|
||||||
"image"
|
"image"
|
||||||
"runtime"
|
"runtime"
|
||||||
)
|
)
|
||||||
|
@ -9,8 +9,8 @@ package cocoa
|
|||||||
//
|
//
|
||||||
import "C"
|
import "C"
|
||||||
import (
|
import (
|
||||||
"github.com/hajimehoshi/go-ebiten/graphics"
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
"github.com/hajimehoshi/go-ebiten/ui"
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
)
|
)
|
||||||
|
|
||||||
type cocoaUI struct {
|
type cocoaUI struct {
|
||||||
|
65
ui/dummy/dummy.go
Normal file
65
ui/dummy/dummy.go
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package dummy
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/hajimehoshi/ebiten/graphics"
|
||||||
|
"github.com/hajimehoshi/ebiten/ui"
|
||||||
|
"image"
|
||||||
|
)
|
||||||
|
|
||||||
|
type TextureFactory struct{}
|
||||||
|
|
||||||
|
func (t *TextureFactory) CreateRenderTarget(width, height int, filter graphics.Filter) (graphics.RenderTargetId, error) {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (t *TextureFactory) CreateTexture(img image.Image, filter graphics.Filter) (graphics.TextureId, error) {
|
||||||
|
return 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type UI struct{}
|
||||||
|
|
||||||
|
func (u *UI) CreateCanvas(widht, height, scale int, title string) ui.Canvas {
|
||||||
|
return &Canvas{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *UI) Start() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *UI) DoEvents() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *UI)Terminate() {
|
||||||
|
}
|
||||||
|
|
||||||
|
type Keys struct{}
|
||||||
|
|
||||||
|
func (k *Keys) Includes(key ui.Key) bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
type InputState struct{}
|
||||||
|
|
||||||
|
func (i *InputState) PressedKeys() ui.Keys {
|
||||||
|
return &Keys{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i *InputState) MouseX() int {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i *InputState) MouseY() int {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
type Canvas struct{}
|
||||||
|
|
||||||
|
func (c *Canvas) Draw(func(graphics.Context)) {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Canvas) IsClosed() bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *Canvas) InputState() ui.InputState {
|
||||||
|
return &InputState{}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user