Add comments

This commit is contained in:
Hajime Hoshi 2015-02-20 02:01:56 +09:00
parent 79f76ab7c8
commit 936942a28d
4 changed files with 2 additions and 4 deletions

View File

@ -45,6 +45,7 @@ func (c *graphicsContext) preUpdate() 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 {
return err
}

View File

@ -160,7 +160,6 @@ func (c *Context) DeleteFramebuffer(f Framebuffer) {
func (c *Context) NewShader(shaderType ShaderType, source string) (Shader, error) {
s := gl.CreateShader(uint32(shaderType))
if s == 0 {
println(gl.GetError())
return 0, errors.New("glCreateShader failed")
}

View File

@ -243,6 +243,7 @@ func (u *userInterface) start(width, height, scale int, title string) (actualSca
func (*userInterface) size() (width, height int) {
a := canvas.Get("dataset").Get("ebitenActualScale").Int()
if a == 0 {
// a == 0 only on the initial state.
return
}
width = canvas.Get("width").Int() / a

3
run.go
View File

@ -105,9 +105,6 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
}
audio.Tick()
ui.SwapBuffers()
if err != nil {
return err
}
// Calc the current FPS.
now := ui.Now()