mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 02:38:53 +01:00
internal/graphicsdriver/opengl/gl: refactoring
This commit is contained in:
parent
0d8912e7ae
commit
056042ca92
@ -40,10 +40,7 @@ func (c *defaultContext) init() error {
|
||||
|
||||
func (c *defaultContext) getProcAddress(name string) uintptr {
|
||||
if c.isES {
|
||||
const ext = "EXT"
|
||||
if strings.HasSuffix(name, ext) {
|
||||
name = name[:len(name)-len(ext)]
|
||||
}
|
||||
name = strings.TrimSuffix(name, "EXT")
|
||||
}
|
||||
return purego.Dlsym(opengl, name)
|
||||
}
|
||||
|
@ -106,9 +106,8 @@ func getProcAddressGL(name string) unsafe.Pointer {
|
||||
}
|
||||
|
||||
func getProcAddressGLES(name string) unsafe.Pointer {
|
||||
const ext = "EXT"
|
||||
if strings.HasSuffix(name, ext) {
|
||||
name = name[:len(name)-len(ext)]
|
||||
name = strings.TrimSuffix(name, "EXT")
|
||||
}
|
||||
cname := C.CString(name)
|
||||
defer C.free(unsafe.Pointer(cname))
|
||||
|
Loading…
Reference in New Issue
Block a user