mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +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)
|
webglContext := js.Global.Call("require", "gl").Invoke(16, 16, options)
|
||||||
gl = &webgl.Context{Object: webglContext}
|
gl = &webgl.Context{Object: webglContext}
|
||||||
}
|
}
|
||||||
|
c := &Context{}
|
||||||
c := &Context{
|
|
||||||
locationCache: newLocationCache(),
|
|
||||||
lastCompositeMode: CompositeModeUnknown,
|
|
||||||
}
|
|
||||||
c.gl = gl
|
c.gl = gl
|
||||||
c.init()
|
|
||||||
return c, nil
|
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 {
|
func (c *Context) Reset() error {
|
||||||
c.locationCache = newLocationCache()
|
c.locationCache = newLocationCache()
|
||||||
c.lastFramebuffer = invalidFramebuffer
|
c.lastFramebuffer = invalidFramebuffer
|
||||||
|
Loading…
Reference in New Issue
Block a user