mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
openg: Refactoring
This commit is contained in:
parent
de541bdd7d
commit
df23b57b16
@ -47,9 +47,7 @@ func (p Program) id() programID {
|
||||
}
|
||||
|
||||
type context struct {
|
||||
locationCache *locationCache
|
||||
funcs chan func()
|
||||
lastCompositeMode CompositeMode
|
||||
funcs chan func()
|
||||
}
|
||||
|
||||
func NewContext() (*Context, error) {
|
||||
@ -70,10 +68,10 @@ func NewContext() (*Context, error) {
|
||||
dstAlpha: gl.DST_ALPHA,
|
||||
oneMinusSrcAlpha: gl.ONE_MINUS_SRC_ALPHA,
|
||||
oneMinusDstAlpha: gl.ONE_MINUS_DST_ALPHA,
|
||||
locationCache: newLocationCache(),
|
||||
lastCompositeMode: CompositeModeUnknown,
|
||||
}
|
||||
c.locationCache = newLocationCache()
|
||||
c.funcs = make(chan func())
|
||||
c.lastCompositeMode = CompositeModeUnknown
|
||||
return c, nil
|
||||
}
|
||||
|
||||
|
@ -63,11 +63,9 @@ func (p Program) id() programID {
|
||||
}
|
||||
|
||||
type context struct {
|
||||
gl *webgl.Context
|
||||
lastFramebuffer Framebuffer
|
||||
locationCache *locationCache
|
||||
lastProgramID programID
|
||||
lastCompositeMode CompositeMode
|
||||
gl *webgl.Context
|
||||
lastFramebuffer Framebuffer
|
||||
lastProgramID programID
|
||||
}
|
||||
|
||||
func NewContext() (*Context, error) {
|
||||
@ -112,10 +110,10 @@ func NewContext() (*Context, error) {
|
||||
dstAlpha: operation(gl.DST_ALPHA),
|
||||
oneMinusSrcAlpha: operation(gl.ONE_MINUS_SRC_ALPHA),
|
||||
oneMinusDstAlpha: operation(gl.ONE_MINUS_DST_ALPHA),
|
||||
locationCache: newLocationCache(),
|
||||
lastCompositeMode: CompositeModeUnknown,
|
||||
}
|
||||
c.gl = gl
|
||||
c.locationCache = newLocationCache()
|
||||
c.lastCompositeMode = CompositeModeUnknown
|
||||
c.init()
|
||||
return c, nil
|
||||
}
|
||||
|
@ -48,9 +48,7 @@ func (p Program) id() programID {
|
||||
}
|
||||
|
||||
type context struct {
|
||||
gl mgl.Context
|
||||
locationCache *locationCache
|
||||
lastCompositeMode CompositeMode
|
||||
gl mgl.Context
|
||||
}
|
||||
|
||||
func NewContext() *Context {
|
||||
@ -65,9 +63,9 @@ func NewContext() *Context {
|
||||
StaticDraw: mgl.STATIC_DRAW,
|
||||
Triangles: mgl.TRIANGLES,
|
||||
Lines: mgl.LINES,
|
||||
locationCache: newLocationCache(),
|
||||
lastCompositeMode: CompositeModeUnknown,
|
||||
}
|
||||
c.locationCache = newLocationCache()
|
||||
c.lastCompositeMode = CompositeModeUnknown
|
||||
return c
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,8 @@ type Context struct {
|
||||
dstAlpha operation
|
||||
oneMinusSrcAlpha operation
|
||||
oneMinusDstAlpha operation
|
||||
locationCache *locationCache
|
||||
lastCompositeMode CompositeMode
|
||||
context
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user