mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 19:28:57 +01:00
30 lines
672 B
Go
30 lines
672 B
Go
// Code generated by glow (https://github.com/hajimehoshi/glow's for_ebiten branch). 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())
|
|
}
|