mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
Refactoring
This commit is contained in:
parent
e4ab8de45e
commit
0bf319f7d0
@ -37,12 +37,12 @@ func New(width, height int, filter texture.Filter) (
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
framebuffer := C.GLuint(0)
|
f := func(native interface{}) interface{}{
|
||||||
tex.CreateFramebuffer(func(native interface{}) {
|
return createFramebuffer(C.GLuint(native.(texture.Native)))
|
||||||
framebuffer =
|
}
|
||||||
createFramebuffer(C.GLuint(native.(texture.Native)))
|
framebuffer := tex.CreateFramebuffer(f)
|
||||||
})
|
return rendertarget.NewWithFramebuffer(tex,
|
||||||
return rendertarget.NewWithFramebuffer(tex, Framebuffer(framebuffer)), nil
|
Framebuffer(framebuffer.(C.GLuint))), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewWithFramebuffer(width, height int, framebuffer Framebuffer,
|
func NewWithFramebuffer(width, height int, framebuffer Framebuffer,
|
||||||
|
@ -126,6 +126,7 @@ func (texture *Texture) DrawParts(parts []graphics.TexturePart,
|
|||||||
draw(texture.native, quads)
|
draw(texture.native, quads)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (texture *Texture) CreateFramebuffer(create func(native interface{})) {
|
func (texture *Texture) CreateFramebuffer(
|
||||||
create(texture.native)
|
create func(native interface{}) interface{}) interface{} {
|
||||||
|
return create(texture.native)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user