mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
Remove TODOs
This commit is contained in:
parent
6453273bac
commit
d96de18074
@ -110,6 +110,5 @@ func (f *Framebuffer) DrawTexture(c *opengl.Context, t *Texture, quads TextureQu
|
||||
return err
|
||||
}
|
||||
projectionMatrix := f.projectionMatrix()
|
||||
// TODO: Define texture.Draw()
|
||||
return shader.DrawTexture(c, t.native, projectionMatrix, quads, geo, clr)
|
||||
}
|
||||
|
@ -43,7 +43,8 @@ func DrawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4
|
||||
// unsafe.SizeOf can't be used because unsafe doesn't work with GopherJS.
|
||||
const float32Size = 4
|
||||
|
||||
// TODO: Check len(quads) and gl.MAX_ELEMENTS_INDICES?
|
||||
// TODO: WebGL doesn't seem to have Check gl.MAX_ELEMENTS_VERTICES or gl.MAX_ELEMENTS_INDICES so far.
|
||||
// Let's use them to compare to len(quads).
|
||||
const stride = 4 * 4
|
||||
if !initialized {
|
||||
if err := initialize(c); err != nil {
|
||||
@ -58,7 +59,8 @@ func DrawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4
|
||||
|
||||
program := useProgramColorMatrix(c, glMatrix(projectionMatrix), geo, color)
|
||||
|
||||
// TODO: Do we have to call gl.ActiveTexture(gl.TEXTURE0)?
|
||||
// We don't have to call gl.ActiveTexture here: GL_TEXTURE0 is the default active texture
|
||||
// See also: https://www.opengl.org/sdk/docs/man2/xhtml/glActiveTexture.xml
|
||||
c.BindTexture(texture)
|
||||
|
||||
c.EnableVertexAttribArray(program, "vertex")
|
||||
|
@ -76,7 +76,6 @@ func (c *Context) TexturePixels(t Texture, width, height int) ([]uint8, error) {
|
||||
gl.Texture(t).Bind(gl.TEXTURE_2D)
|
||||
gl.GetTexImage(gl.TEXTURE_2D, 0, gl.RGBA, gl.UNSIGNED_BYTE, pixels)
|
||||
if e := gl.GetError(); e != gl.NO_ERROR {
|
||||
// TODO: Use glu.ErrorString
|
||||
return nil, errors.New(fmt.Sprintf("gl error: %d", e))
|
||||
}
|
||||
return pixels, nil
|
||||
|
@ -89,7 +89,6 @@ func (c *Context) TexturePixels(t Texture, width, height int) ([]uint8, error) {
|
||||
gl.BindTexture(gl.TEXTURE_2D, t)
|
||||
gl.ReadPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels)
|
||||
if e := gl.GetError(); e != gl.NO_ERROR {
|
||||
// TODO: Use glu.ErrorString
|
||||
return nil, errors.New(fmt.Sprintf("gl error: %d", e))
|
||||
}
|
||||
return pixels.Interface().([]uint8), nil
|
||||
|
Loading…
Reference in New Issue
Block a user