mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
opengl: Remove init (JavaScript)
This commit is contained in:
parent
0d91883fb9
commit
6cfb92c4c4
@ -108,25 +108,11 @@ func NewContext() (*Context, error) {
|
||||
webglContext := js.Global.Call("require", "gl").Invoke(16, 16, options)
|
||||
gl = &webgl.Context{Object: webglContext}
|
||||
}
|
||||
|
||||
c := &Context{
|
||||
locationCache: newLocationCache(),
|
||||
lastCompositeMode: CompositeModeUnknown,
|
||||
}
|
||||
c := &Context{}
|
||||
c.gl = gl
|
||||
c.init()
|
||||
return c, nil
|
||||
}
|
||||
|
||||
func (c *Context) init() {
|
||||
gl := c.gl
|
||||
// Textures' pixel formats are alpha premultiplied.
|
||||
gl.Enable(gl.BLEND)
|
||||
c.BlendFunc(CompositeModeSourceOver)
|
||||
f := gl.GetParameter(gl.FRAMEBUFFER_BINDING)
|
||||
c.screenFramebuffer = Framebuffer{f}
|
||||
}
|
||||
|
||||
func (c *Context) Reset() error {
|
||||
c.locationCache = newLocationCache()
|
||||
c.lastFramebuffer = invalidFramebuffer
|
||||
|
Loading…
Reference in New Issue
Block a user