mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
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())
|
||
|
}
|