forked from Ohmnivore/HaxeNet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.txt
25 lines (17 loc) · 1.27 KB
/
README.txt
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
Here be Haxe bindings for ENet!
ENet is a really solid reliable/unreliable UDP implementation written in C:
https://github.com/lsalzman/enet
Some familiarity with ENet might help:
http://enet.bespin.org/
With these wrappers, you should be able to release online multiplayer games for Haxe's C++ target.
I wrote this with HaxeFlixel in mind, but you should be able to use just about any other game engine that supports the C++ target.
To use this in your project, grab the /source/enet directory and put that in your source directory.
Also, copy the .ndll from my /export/cpp/windows/bin directory to the directory containing your executable. (32-bit ndll)
All you need to send/receive messages is the collection of static methods found in ENet.hx, and the event class from ENetEvent.hx.
But if you want a higher-level structure, use Client.hx and Server.hx. Take a look at MenuState.hx, TestClient.hx and TestServer.hx
to see how to use these classes.
This is my first adventure in C/C++, so that part of the code might not be stellar.
The .ndll provided has been compiled for Windows. I honestly don't know how to provide support for Linux and Mac, sorry. If someone could help for that it would be great.
TODO:
make sure everything is garbage collected?
Linux + Mac + Android + iOS? ndlls