mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-26 02:42:02 +01:00
Refactoring
This commit is contained in:
parent
f0ef3384cb
commit
5fbfb3a3a3
@ -70,6 +70,7 @@ func (context *Context) DrawTextureParts(
|
||||
context.offscreen.DrawTextureParts(tex, parts, geometryMatrix, colorMatrix)
|
||||
}
|
||||
|
||||
// Init initializes the context. The initial state is saved for each GL context.
|
||||
func (context *Context) Init() {
|
||||
C.glEnable(C.GL_TEXTURE_2D)
|
||||
C.glEnable(C.GL_BLEND)
|
||||
|
@ -28,8 +28,6 @@ func New(screenWidth, screenHeight, screenScale int) *Offscreen {
|
||||
screenScale: screenScale,
|
||||
}
|
||||
|
||||
// The main framebuffer should be created sooner than any other
|
||||
// framebuffers!
|
||||
mainFramebuffer := C.GLint(0)
|
||||
C.glGetIntegerv(C.GL_FRAMEBUFFER_BINDING, &mainFramebuffer)
|
||||
|
||||
|
@ -49,7 +49,7 @@ func Create(width, height int, filter texture.Filter) (
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return tex.NewRenderTarget(&framebufferCreator{}), tex, nil
|
||||
return tex.CreateRenderTarget(&framebufferCreator{}), tex, nil
|
||||
}
|
||||
|
||||
func CreateWithFramebuffer(width, height int, framebuffer Framebuffer) (
|
||||
|
@ -111,7 +111,6 @@ type FramebufferCreator interface {
|
||||
Create(native interface{}) interface{}
|
||||
}
|
||||
|
||||
func (texture *Texture) NewRenderTarget(creator FramebufferCreator) *RenderTarget {
|
||||
func (texture *Texture) CreateRenderTarget(creator FramebufferCreator) *RenderTarget {
|
||||
return NewRenderTarget(creator.Create(texture.native), texture.width, texture.height)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user