mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
Remove gl.go
This commit is contained in:
parent
de7d980289
commit
26122aa120
@ -34,7 +34,11 @@ func NewTextures(textureFactory graphics.TextureFactory) *Textures {
|
||||
textures: map[string]graphics.TextureId{},
|
||||
renderTargets: map[string]graphics.RenderTargetId{},
|
||||
}
|
||||
go textures.loop()
|
||||
go func() {
|
||||
for {
|
||||
textures.loopMain()
|
||||
}
|
||||
}()
|
||||
return textures
|
||||
}
|
||||
|
||||
@ -52,8 +56,7 @@ func loadImage(path string) (image.Image, error) {
|
||||
return img, nil
|
||||
}
|
||||
|
||||
func (t *Textures) loop() {
|
||||
for {
|
||||
func (t *Textures) loopMain() {
|
||||
select {
|
||||
case p := <-t.texturePaths:
|
||||
name := p.name
|
||||
@ -89,7 +92,6 @@ func (t *Textures) loop() {
|
||||
t.renderTargets[name] = id
|
||||
}()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (t *Textures) RequestTexture(name string, path string) {
|
||||
|
@ -5,6 +5,21 @@ import (
|
||||
"github.com/hajimehoshi/go-ebiten/graphics/matrix"
|
||||
)
|
||||
|
||||
// #cgo LDFLAGS: -framework OpenGL
|
||||
//
|
||||
// #include <stdlib.h>
|
||||
// #include <OpenGL/gl.h>
|
||||
import "C"
|
||||
|
||||
func enableAlphaBlending() {
|
||||
C.glEnable(C.GL_TEXTURE_2D)
|
||||
C.glEnable(C.GL_BLEND)
|
||||
}
|
||||
|
||||
func flush() {
|
||||
C.glFlush()
|
||||
}
|
||||
|
||||
type Context struct {
|
||||
screenId graphics.RenderTargetId
|
||||
mainId graphics.RenderTargetId
|
||||
|
@ -1,16 +0,0 @@
|
||||
package opengl
|
||||
|
||||
// #cgo LDFLAGS: -framework OpenGL
|
||||
//
|
||||
// #include <stdlib.h>
|
||||
// #include <OpenGL/gl.h>
|
||||
import "C"
|
||||
|
||||
func enableAlphaBlending() {
|
||||
C.glEnable(C.GL_TEXTURE_2D)
|
||||
C.glEnable(C.GL_BLEND)
|
||||
}
|
||||
|
||||
func flush() {
|
||||
C.glFlush()
|
||||
}
|
Loading…
Reference in New Issue
Block a user