mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
Add comments
This commit is contained in:
parent
79f76ab7c8
commit
936942a28d
@ -45,6 +45,7 @@ func (c *graphicsContext) preUpdate() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *graphicsContext) postUpdate() error {
|
func (c *graphicsContext) postUpdate() error {
|
||||||
|
// TODO: In WebGL, we don't need to clear the image here.
|
||||||
if err := c.defaultRenderTarget.Clear(); err != nil {
|
if err := c.defaultRenderTarget.Clear(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,6 @@ func (c *Context) DeleteFramebuffer(f Framebuffer) {
|
|||||||
func (c *Context) NewShader(shaderType ShaderType, source string) (Shader, error) {
|
func (c *Context) NewShader(shaderType ShaderType, source string) (Shader, error) {
|
||||||
s := gl.CreateShader(uint32(shaderType))
|
s := gl.CreateShader(uint32(shaderType))
|
||||||
if s == 0 {
|
if s == 0 {
|
||||||
println(gl.GetError())
|
|
||||||
return 0, errors.New("glCreateShader failed")
|
return 0, errors.New("glCreateShader failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,6 +243,7 @@ func (u *userInterface) start(width, height, scale int, title string) (actualSca
|
|||||||
func (*userInterface) size() (width, height int) {
|
func (*userInterface) size() (width, height int) {
|
||||||
a := canvas.Get("dataset").Get("ebitenActualScale").Int()
|
a := canvas.Get("dataset").Get("ebitenActualScale").Int()
|
||||||
if a == 0 {
|
if a == 0 {
|
||||||
|
// a == 0 only on the initial state.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
width = canvas.Get("width").Int() / a
|
width = canvas.Get("width").Int() / a
|
||||||
|
Loading…
Reference in New Issue
Block a user