mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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 {
|
func (c *defaultContext) getProcAddress(name string) uintptr {
|
||||||
if c.isES {
|
if c.isES {
|
||||||
const ext = "EXT"
|
name = strings.TrimSuffix(name, "EXT")
|
||||||
if strings.HasSuffix(name, ext) {
|
|
||||||
name = name[:len(name)-len(ext)]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return purego.Dlsym(opengl, name)
|
return purego.Dlsym(opengl, name)
|
||||||
}
|
}
|
||||||
|
@ -106,9 +106,8 @@ func getProcAddressGL(name string) unsafe.Pointer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func getProcAddressGLES(name string) unsafe.Pointer {
|
func getProcAddressGLES(name string) unsafe.Pointer {
|
||||||
const ext = "EXT"
|
|
||||||
if strings.HasSuffix(name, ext) {
|
if strings.HasSuffix(name, ext) {
|
||||||
name = name[:len(name)-len(ext)]
|
name = strings.TrimSuffix(name, "EXT")
|
||||||
}
|
}
|
||||||
cname := C.CString(name)
|
cname := C.CString(name)
|
||||||
defer C.free(unsafe.Pointer(cname))
|
defer C.free(unsafe.Pointer(cname))
|
||||||
|
Loading…
Reference in New Issue
Block a user