Skip to content

Commit

Permalink
Resolve merge conflicts -.-
Browse files Browse the repository at this point in the history
  • Loading branch information
JupiterRider committed Nov 14, 2023
1 parent 45c6718 commit c5cba9a
Show file tree
Hide file tree
Showing 4 changed files with 3,641 additions and 0 deletions.
5 changes: 5 additions & 0 deletions raylib/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
module github.com/gen2brain/raylib-go/raylib

go 1.21

require (
github.com/ebitengine/purego v0.5.0
golang.org/x/sys v0.14.0
)
4 changes: 4 additions & 0 deletions raylib/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
github.com/ebitengine/purego v0.5.0 h1:JrMGKfRIAM4/QVKaesIIT7m/UVjTj5GYhRSQYwfVdpo=
github.com/ebitengine/purego v0.5.0/go.mod h1:ah1In8AOtksoNK6yk5z1HTJeUkC1Ez4Wk2idgGslMwQ=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
31 changes: 31 additions & 0 deletions raylib/purego_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//go:build !cgo && windows
// +build !cgo,windows

package rl

import (
"fmt"

"github.com/ebitengine/purego"
"golang.org/x/sys/windows"
)

const (
libname = "raylib.dll"
)

// loadLibrary loads the raylib dll and panics on error
func loadLibrary() uintptr {
if handle, err := windows.LoadLibrary(libname); err != nil {
panic(fmt.Errorf("cannot load library %s: %w", libname, err))
} else {
return uintptr(handle)
}
}

func traceLogCallbackWrapper(fn TraceLogCallbackFun) uintptr {
return purego.NewCallback(func(logLevel int32, text *byte) uintptr {
fn(int(logLevel), windows.BytePtrToString(text))
return 0
})
}
Loading

0 comments on commit c5cba9a

Please sign in to comment.