mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
Resolve TODOs
This commit is contained in:
parent
02b1f7d798
commit
636ae84ad5
@ -28,8 +28,6 @@ const (
|
||||
screenHeight = 240
|
||||
)
|
||||
|
||||
// TODO: Add Key.String() by stringer
|
||||
|
||||
var keyNames = map[ebiten.Key]string{
|
||||
ebiten.KeyBackspace: "Backspace",
|
||||
ebiten.KeyComma: "','",
|
||||
|
@ -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)?
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user