mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +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
|
||||
|
||||
// TODO: This should be a method?
|
||||
func GetProgramID(p Program) ProgramID {
|
||||
func (p Program) ID() ProgramID {
|
||||
return ProgramID(p)
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ type AttribLocation int
|
||||
|
||||
type ProgramID int
|
||||
|
||||
func GetProgramID(p Program) ProgramID {
|
||||
func (p Program) ID() ProgramID {
|
||||
return ProgramID(p.Get("__ebiten_programId").Int())
|
||||
}
|
||||
|
||||
|
@ -43,7 +43,7 @@ type AttribLocation mgl.Attrib
|
||||
|
||||
type ProgramID uint32
|
||||
|
||||
func GetProgramID(p Program) ProgramID {
|
||||
func (p Program) ID() ProgramID {
|
||||
return ProgramID(p.Value)
|
||||
}
|
||||
|
||||
|
@ -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 := GetProgramID(p)
|
||||
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 := GetProgramID(p)
|
||||
id := p.ID()
|
||||
if _, ok := attribLocationCache[id]; !ok {
|
||||
attribLocationCache[id] = map[string]AttribLocation{}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user