mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
opengl: GetProgramID() -> Program.ID()
This commit is contained in:
parent
7617a225f6
commit
f432c15078
@ -42,8 +42,7 @@ type AttribLocation int32
|
|||||||
|
|
||||||
type ProgramID uint32
|
type ProgramID uint32
|
||||||
|
|
||||||
// TODO: This should be a method?
|
func (p Program) ID() ProgramID {
|
||||||
func GetProgramID(p Program) ProgramID {
|
|
||||||
return ProgramID(p)
|
return ProgramID(p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ type AttribLocation int
|
|||||||
|
|
||||||
type ProgramID int
|
type ProgramID int
|
||||||
|
|
||||||
func GetProgramID(p Program) ProgramID {
|
func (p Program) ID() ProgramID {
|
||||||
return ProgramID(p.Get("__ebiten_programId").Int())
|
return ProgramID(p.Get("__ebiten_programId").Int())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ type AttribLocation mgl.Attrib
|
|||||||
|
|
||||||
type ProgramID uint32
|
type ProgramID uint32
|
||||||
|
|
||||||
func GetProgramID(p Program) ProgramID {
|
func (p Program) ID() ProgramID {
|
||||||
return ProgramID(p.Value)
|
return ProgramID(p.Value)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ type UniformLocationGetter interface {
|
|||||||
// TODO: Rename these functions not to be confusing
|
// TODO: Rename these functions not to be confusing
|
||||||
|
|
||||||
func GetUniformLocation(g UniformLocationGetter, p Program, location string) UniformLocation {
|
func GetUniformLocation(g UniformLocationGetter, p Program, location string) UniformLocation {
|
||||||
id := GetProgramID(p)
|
id := p.ID()
|
||||||
if _, ok := uniformLocationCache[id]; !ok {
|
if _, ok := uniformLocationCache[id]; !ok {
|
||||||
uniformLocationCache[id] = map[string]UniformLocation{}
|
uniformLocationCache[id] = map[string]UniformLocation{}
|
||||||
}
|
}
|
||||||
@ -43,7 +43,7 @@ type AttribLocationGetter interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetAttribLocation(g AttribLocationGetter, p Program, location string) AttribLocation {
|
func GetAttribLocation(g AttribLocationGetter, p Program, location string) AttribLocation {
|
||||||
id := GetProgramID(p)
|
id := p.ID()
|
||||||
if _, ok := attribLocationCache[id]; !ok {
|
if _, ok := attribLocationCache[id]; !ok {
|
||||||
attribLocationCache[id] = map[string]AttribLocation{}
|
attribLocationCache[id] = map[string]AttribLocation{}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user