mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-15 07:27:32 +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())
|
|
}
|