diff --git a/example/keyboard/main.go b/example/keyboard/main.go index afd61e002..9635ea3b9 100644 --- a/example/keyboard/main.go +++ b/example/keyboard/main.go @@ -28,8 +28,6 @@ const ( screenHeight = 240 ) -// TODO: Add Key.String() by stringer - var keyNames = map[ebiten.Key]string{ ebiten.KeyBackspace: "Backspace", ebiten.KeyComma: "','", diff --git a/internal/graphics/internal/shader/drawtexture.go b/internal/graphics/internal/shader/drawtexture.go index e38859abf..60022ab29 100644 --- a/internal/graphics/internal/shader/drawtexture.go +++ b/internal/graphics/internal/shader/drawtexture.go @@ -39,10 +39,10 @@ type TextureQuads interface { var initialized = false -// TODO: Use unsafe.SizeOf? -const float32Size = 4 - func DrawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4][4]float64, quads TextureQuads, geo Matrix, color Matrix) error { + // 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? const stride = 4 * 4 if !initialized { @@ -56,7 +56,6 @@ func DrawTexture(c *opengl.Context, texture opengl.Texture, projectionMatrix *[4 return nil } - // TODO: Check performance program := useProgramColorMatrix(c, glMatrix(projectionMatrix), geo, color) // TODO: Do we have to call gl.ActiveTexture(gl.TEXTURE0)? diff --git a/internal/graphics/internal/shader/program.go b/internal/graphics/internal/shader/program.go index d176995be..ae79a78b1 100644 --- a/internal/graphics/internal/shader/program.go +++ b/internal/graphics/internal/shader/program.go @@ -46,8 +46,7 @@ func initialize(c *opengl.Context) error { } const stride = 4 * 4 - v := make([]float32, stride*size) - c.NewBuffer(c.ArrayBuffer, v, c.DynamicDraw) + c.NewBuffer(c.ArrayBuffer, stride*size, c.DynamicDraw) indices := make([]uint16, 6*size) for i := uint16(0); i < size; i++ { @@ -70,7 +69,6 @@ func useProgramColorMatrix(c *opengl.Context, projectionMatrix []float32, geo Ma c.UseProgram(programColorMatrix) lastProgram = programColorMatrix } - // TODO: Check the performance. program := programColorMatrix c.UniformFloats(program, "projection_matrix", projectionMatrix) diff --git a/internal/graphics/internal/shader/shader.go b/internal/graphics/internal/shader/shader.go index e2536068d..5beb31093 100644 --- a/internal/graphics/internal/shader/shader.go +++ b/internal/graphics/internal/shader/shader.go @@ -35,7 +35,6 @@ func shader(c *opengl.Context, id shaderId) string { return str } -// TODO: Create version 100 for WebGL var shaders = map[shaderId]string{ shaderVertex: ` uniform highp mat4 projection_matrix; diff --git a/internal/opengl/context_js.go b/internal/opengl/context_js.go index d4247c96e..ef90e6f77 100644 --- a/internal/opengl/context_js.go +++ b/internal/opengl/context_js.go @@ -259,7 +259,6 @@ func (c *Context) NewBuffer(bufferType BufferType, v interface{}, bufferUsageTyp gl := c.gl b := gl.CreateBuffer() gl.BindBuffer(int(bufferType), b) - // TODO: Can we assign integer to gl.bufferData? gl.BufferData(int(bufferType), v, int(bufferUsageType)) }