diff --git a/internal/graphics/opengl/context_desktop.go b/internal/graphics/opengl/context_desktop.go index c5167bca6..74281c6fd 100644 --- a/internal/graphics/opengl/context_desktop.go +++ b/internal/graphics/opengl/context_desktop.go @@ -40,10 +40,10 @@ func (p Program) Equals(other Program) bool { type UniformLocation int32 type AttribLocation int32 -type ProgramID uint32 +type programID uint32 -func (p Program) ID() ProgramID { - return ProgramID(p) +func (p Program) id() programID { + return programID(p) } type context struct { diff --git a/internal/graphics/opengl/context_js.go b/internal/graphics/opengl/context_js.go index f0e04f4d1..a40a98ebe 100644 --- a/internal/graphics/opengl/context_js.go +++ b/internal/graphics/opengl/context_js.go @@ -56,10 +56,10 @@ type UniformLocation struct { type AttribLocation int -type ProgramID int +type programID int -func (p Program) ID() ProgramID { - return ProgramID(p.Get("__ebiten_programId").Int()) +func (p Program) id() programID { + return programID(p.Get("__ebiten_programId").Int()) } type context struct { @@ -264,7 +264,7 @@ func (c *Context) GlslHighpSupported() bool { return gl.Call("getShaderPrecisionFormat", gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).Get("precision").Int() != 0 } -var lastProgramID ProgramID = 0 +var lastProgramID programID = 0 func (c *Context) NewProgram(shaders []Shader) (Program, error) { gl := c.gl diff --git a/internal/graphics/opengl/context_mobile.go b/internal/graphics/opengl/context_mobile.go index 044e08566..0d1dedfe0 100644 --- a/internal/graphics/opengl/context_mobile.go +++ b/internal/graphics/opengl/context_mobile.go @@ -41,10 +41,10 @@ func (p Program) Equals(other Program) bool { type UniformLocation mgl.Uniform type AttribLocation mgl.Attrib -type ProgramID uint32 +type programID uint32 -func (p Program) ID() ProgramID { - return ProgramID(p.Value) +func (p Program) id() programID { + return programID(p.Value) } type context struct { diff --git a/internal/graphics/opengl/locationcache.go b/internal/graphics/opengl/locationcache.go index 8213f06a3..884090617 100644 --- a/internal/graphics/opengl/locationcache.go +++ b/internal/graphics/opengl/locationcache.go @@ -14,10 +14,10 @@ package opengl -// Since js.Object (Program) can't be keys of a map, use integers (ProgramID) instead. +// Since js.Object (Program) can't be keys of a map, use integers (programID) instead. -var uniformLocationCache = map[ProgramID]map[string]UniformLocation{} -var attribLocationCache = map[ProgramID]map[string]AttribLocation{} +var uniformLocationCache = map[programID]map[string]UniformLocation{} +var attribLocationCache = map[programID]map[string]AttribLocation{} type UniformLocationGetter interface { getUniformLocation(p Program, location string) UniformLocation @@ -26,7 +26,7 @@ type UniformLocationGetter interface { // TODO: Rename these functions not to be confusing func GetUniformLocation(g UniformLocationGetter, p Program, location string) UniformLocation { - id := p.ID() + id := p.id() if _, ok := uniformLocationCache[id]; !ok { uniformLocationCache[id] = map[string]UniformLocation{} } @@ -43,7 +43,7 @@ type AttribLocationGetter interface { } func GetAttribLocation(g AttribLocationGetter, p Program, location string) AttribLocation { - id := p.ID() + id := p.id() if _, ok := attribLocationCache[id]; !ok { attribLocationCache[id] = map[string]AttribLocation{} }