diff --git a/graphics.go b/graphics.go index 8f6a8526a..866394cc3 100644 --- a/graphics.go +++ b/graphics.go @@ -15,14 +15,14 @@ package ebiten import ( - "github.com/hajimehoshi/ebiten/internal/opengl" + "github.com/hajimehoshi/ebiten/internal/graphics" ) // Filter represents the type of filter to be used when an image is maginified or minified. -type Filter opengl.Filter +type Filter graphics.Filter // Filters const ( - FilterNearest = Filter(opengl.FilterNearest) - FilterLinear = Filter(opengl.FilterLinear) + FilterNearest = Filter(graphics.FilterNearest) + FilterLinear = Filter(graphics.FilterLinear) ) diff --git a/graphicscontext.go b/graphicscontext.go index ed95f3117..d54e877e7 100644 --- a/graphicscontext.go +++ b/graphicscontext.go @@ -15,16 +15,16 @@ package ebiten import ( - "github.com/hajimehoshi/ebiten/internal/opengl" + "github.com/hajimehoshi/ebiten/internal/graphics" ) func newGraphicsContext(screenWidth, screenHeight, screenScale int) (*graphicsContext, error) { - f, err := opengl.NewZeroFramebuffer(screenWidth*screenScale, screenHeight*screenScale) + f, err := graphics.NewZeroFramebuffer(screenWidth*screenScale, screenHeight*screenScale) if err != nil { return nil, err } - texture, err := opengl.NewTexture(screenWidth, screenHeight, opengl.Filter(FilterNearest)) + texture, err := graphics.NewTexture(screenWidth, screenHeight, graphics.Filter(FilterNearest)) if err != nil { return nil, err } diff --git a/image.go b/image.go index 060a870c7..593e1bd0a 100644 --- a/image.go +++ b/image.go @@ -16,18 +16,18 @@ package ebiten import ( "github.com/hajimehoshi/ebiten/internal" - "github.com/hajimehoshi/ebiten/internal/opengl" + "github.com/hajimehoshi/ebiten/internal/graphics" "image" "image/color" ) type innerImage struct { - framebuffer *opengl.Framebuffer - texture *opengl.Texture + framebuffer *graphics.Framebuffer + texture *graphics.Texture } -func newInnerImage(texture *opengl.Texture) (*innerImage, error) { - framebuffer, err := opengl.NewFramebufferFromTexture(texture) +func newInnerImage(texture *graphics.Texture) (*innerImage, error) { + framebuffer, err := graphics.NewFramebufferFromTexture(texture) if err != nil { return nil, err } diff --git a/internal/opengl/framebuffer.go b/internal/graphics/framebuffer.go similarity index 97% rename from internal/opengl/framebuffer.go rename to internal/graphics/framebuffer.go index c29886e5b..7835e0a84 100644 --- a/internal/opengl/framebuffer.go +++ b/internal/graphics/framebuffer.go @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -package opengl +package graphics import ( "errors" "fmt" "github.com/go-gl/gl" "github.com/hajimehoshi/ebiten/internal" - "github.com/hajimehoshi/ebiten/internal/opengl/internal/shader" + "github.com/hajimehoshi/ebiten/internal/graphics/internal/shader" ) func orthoProjectionMatrix(left, right, bottom, top int) [4][4]float64 { diff --git a/internal/opengl/gl.go b/internal/graphics/gl.go similarity index 98% rename from internal/opengl/gl.go rename to internal/graphics/gl.go index 3cd92010e..599d6974c 100644 --- a/internal/opengl/gl.go +++ b/internal/graphics/gl.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package opengl +package graphics import ( "github.com/go-gl/gl" diff --git a/internal/opengl/internal/shader/drawtexture.go b/internal/graphics/internal/shader/drawtexture.go similarity index 100% rename from internal/opengl/internal/shader/drawtexture.go rename to internal/graphics/internal/shader/drawtexture.go diff --git a/internal/opengl/internal/shader/program.go b/internal/graphics/internal/shader/program.go similarity index 100% rename from internal/opengl/internal/shader/program.go rename to internal/graphics/internal/shader/program.go diff --git a/internal/opengl/internal/shader/shader.go b/internal/graphics/internal/shader/shader.go similarity index 100% rename from internal/opengl/internal/shader/shader.go rename to internal/graphics/internal/shader/shader.go diff --git a/internal/opengl/texture.go b/internal/graphics/texture.go similarity index 99% rename from internal/opengl/texture.go rename to internal/graphics/texture.go index 6954f275c..935ff817b 100644 --- a/internal/opengl/texture.go +++ b/internal/graphics/texture.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package opengl +package graphics import ( "errors" diff --git a/ui.go b/ui.go index 9acc1d45c..b2585fed0 100644 --- a/ui.go +++ b/ui.go @@ -17,7 +17,7 @@ package ebiten import ( "fmt" glfw "github.com/go-gl/glfw3" - "github.com/hajimehoshi/ebiten/internal/opengl" + "github.com/hajimehoshi/ebiten/internal/graphics" "image" "runtime" ) @@ -47,7 +47,7 @@ func init() { } currentUI.run() currentUI.use(func() { - opengl.Init() + graphics.Init() glfw.SwapInterval(1) }) } @@ -149,8 +149,8 @@ func (u *ui) newImageFromImage(img image.Image, filter Filter) (*Image, error) { var innerImage *innerImage var err error u.use(func() { - var texture *opengl.Texture - texture, err = opengl.NewTextureFromImage(img, opengl.Filter(filter)) + var texture *graphics.Texture + texture, err = graphics.NewTextureFromImage(img, graphics.Filter(filter)) if err != nil { return } @@ -166,8 +166,8 @@ func (u *ui) newImage(width, height int, filter Filter) (*Image, error) { var innerImage *innerImage var err error u.use(func() { - var texture *opengl.Texture - texture, err = opengl.NewTexture(width, height, opengl.Filter(filter)) + var texture *graphics.Texture + texture, err = graphics.NewTexture(width, height, graphics.Filter(filter)) if err != nil { return }