mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-14 06:57:27 +01:00
30 lines
646 B
Go
30 lines
646 B
Go
// Code generated by glow (https://github.com/go-gl/glow). DO NOT EDIT.
|
|
|
|
package gl
|
|
|
|
import (
|
|
"golang.org/x/sys/windows"
|
|
"unsafe"
|
|
)
|
|
|
|
var (
|
|
opengl32 = windows.NewLazySystemDLL("opengl32")
|
|
wglGetProcAddress = opengl32.NewProc("wglGetProcAddress")
|
|
)
|
|
|
|
func getProcAddress(namea string) unsafe.Pointer {
|
|
cname, err := windows.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())
|
|
}
|