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 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 {

View File

@ -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"
) )

View File

@ -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"
) )

View File

@ -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"

View File

@ -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 {

View File

@ -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() {

View File

@ -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() {

View File

@ -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"
) )

View File

@ -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)

View File

@ -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"

View File

@ -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 {

View File

@ -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() {

View File

@ -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"

View File

@ -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 {

View File

@ -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"
) )

View File

@ -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"
) )

View File

@ -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"
) )

View File

@ -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"

View File

@ -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"
) )

View File

@ -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
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 package ui
import ( import (
"github.com/hajimehoshi/go-ebiten/graphics" "github.com/hajimehoshi/ebiten/graphics"
) )
type Key int type Key int