123456789101112131415161718 |
- #define ENET_IMPLEMENTATION
- #include "network/ENet.h"
- static int enetCounter = 0;
- bool ENet::add() {
- if(enetCounter == 0 && enet_initialize() != 0) {
- return true;
- }
- enetCounter++;
- return false;
- }
- void ENet::remove() {
- if(enetCounter > 0 && --enetCounter == 0) {
- enet_deinitialize();
- }
- }
|