Rename internal/opengl -> internal/graphics

This commit is contained in:
Hajime Hoshi 2014-12-31 02:55:17 +09:00
parent 0f569807e2
commit 450a8da267
10 changed files with 22 additions and 22 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package opengl
package graphics
import (
"errors"

12
ui.go
View File

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