-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathenetc.go
More file actions
29 lines (25 loc) · 721 Bytes
/
Copy pathenetc.go
File metadata and controls
29 lines (25 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package enet
// #cgo !windows CFLAGS: -Ienet/include/
// #cgo !windows LDFLAGS: -Lenet/ -lenet
// #cgo windows CFLAGS: -Ienet/include/
// #cgo windows LDFLAGS: -Lenet/bin/Release -lenet -lWs2_32 -lWinmm
// #include <enet/enet.h>
import "C"
import "fmt"
// Initialize enet
func Initialize() {
C.enet_initialize()
}
// Deinitialize enet
func Deinitialize() {
C.enet_deinitialize()
}
// LinkedVersion returns the linked version of enet currently being used.
// Returns MAJOR.MINOR.PATCH as a string.
func LinkedVersion() string {
var version = uint32(C.enet_linked_version())
major := uint8(version >> 16)
minor := uint8(version >> 8)
patch := uint8(version)
return fmt.Sprintf("%d.%d.%d", major, minor, patch)
}