Fix the module paths (#12)

This commit is contained in:
Hajime Hoshi 2014-12-05 22:16:58 +09:00
parent 69a3dfed40
commit a32973a33e
22 changed files with 109 additions and 44 deletions

View File

@ -1,8 +1,8 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
)
type Field struct {

View File

@ -1,8 +1,8 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
"image/color"
)

View File

@ -1,8 +1,8 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/ui"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/ui"
_ "image/png"
)

View File

@ -1,9 +1,9 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/go-ebiten/ui"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/ui"
"image/color"
"math/rand"
"time"

View File

@ -1,7 +1,7 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/ui"
"github.com/hajimehoshi/ebiten/ui"
)
type Input struct {

View File

@ -1,8 +1,8 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
)
func init() {

View File

@ -1,8 +1,8 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
)
func init() {

View File

@ -1,9 +1,9 @@
package blocks
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/go-ebiten/ui"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/ui"
"image/color"
)

View File

@ -1,10 +1,10 @@
package main
import (
"github.com/hajimehoshi/go-ebiten/example/blocks"
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/ui"
"github.com/hajimehoshi/go-ebiten/ui/cocoa"
"github.com/hajimehoshi/ebiten/example/blocks"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/ui"
"github.com/hajimehoshi/ebiten/ui/dummy"
"os"
"os/signal"
"runtime"
@ -29,10 +29,10 @@ func main() {
const frameTime = time.Duration(int64(time.Second) / int64(fps))
const title = "Ebiten Demo"
u := cocoa.UI()
u := new(dummy.UI)
canvas := u.CreateCanvas(screenWidth, screenHeight, screenScale, title)
textureFactory := cocoa.TextureFactory()
textureFactory := new(dummy.TextureFactory)
var game Game = blocks.NewGame(NewTextures(textureFactory))
tick := time.Tick(frameTime)

View File

@ -1,8 +1,8 @@
package main
import (
"github.com/hajimehoshi/go-ebiten/example/blocks"
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/ebiten/example/blocks"
"github.com/hajimehoshi/ebiten/graphics"
"image"
"os"
"sync"

View File

@ -1,7 +1,7 @@
package graphics
import (
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics/matrix"
)
type Rect struct {

View File

@ -6,8 +6,8 @@ package opengl
// #include <OpenGL/gl.h>
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
)
func enableAlphaBlending() {

View File

@ -5,9 +5,9 @@ package opengl
// #include <OpenGL/gl.h>
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/go-ebiten/graphics/opengl/shader"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics/opengl/shader"
"image"
"math"
"sync"

View File

@ -6,7 +6,7 @@ package opengl
import "C"
import (
"fmt"
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics"
)
type RenderTarget struct {

View File

@ -6,8 +6,8 @@ package shader
// #include <stdlib.h>
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/matrix"
"sync"
"unsafe"
)

View File

@ -6,7 +6,7 @@ package shader
// #include <stdlib.h>
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
"github.com/hajimehoshi/ebiten/graphics/matrix"
"unsafe"
)

View File

@ -5,7 +5,7 @@ package opengl
// #include <OpenGL/gl.h>
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics"
"image"
"unsafe"
)

View File

@ -17,9 +17,9 @@ package cocoa
//
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/opengl"
"github.com/hajimehoshi/go-ebiten/ui"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/opengl"
"github.com/hajimehoshi/ebiten/ui"
"runtime"
"sync"
"time"

View File

@ -8,8 +8,8 @@ package cocoa
//
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/graphics/opengl"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics/opengl"
"image"
"runtime"
)

View File

@ -9,8 +9,8 @@ package cocoa
//
import "C"
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/go-ebiten/ui"
"github.com/hajimehoshi/ebiten/graphics"
"github.com/hajimehoshi/ebiten/ui"
)
type cocoaUI struct {

65
ui/dummy/dummy.go Normal file
View 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{}
}

View File

@ -1,7 +1,7 @@
package ui
import (
"github.com/hajimehoshi/go-ebiten/graphics"
"github.com/hajimehoshi/ebiten/graphics"
)
type Key int