mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 11:18:54 +01:00
e8a1be7748
This is a temporal fix until go-gl/glow#102 is applied.
30 lines
623 B
Go
30 lines
623 B
Go
// Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT.
|
|
|
|
package gl
|
|
|
|
import (
|
|
"syscall"
|
|
"unsafe"
|
|
)
|
|
|
|
var (
|
|
opengl32 = syscall.NewLazyDLL("opengl32")
|
|
wglGetProcAddress = opengl32.NewProc("wglGetProcAddress")
|
|
)
|
|
|
|
func getProcAddress(namea string) unsafe.Pointer {
|
|
cname, err := syscall.BytePtrFromString(namea)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
if r, _, _ := wglGetProcAddress.Call(uintptr(unsafe.Pointer(cname))); r != 0 {
|
|
return unsafe.Pointer(r)
|
|
}
|
|
p := opengl32.NewProc(namea)
|
|
if err := p.Find(); err != nil {
|
|
// The proc is not found.
|
|
return nil
|
|
}
|
|
return unsafe.Pointer(p.Addr())
|
|
}
|