1234567891011121314151617181920 |
- #define ENET_IMPLEMENTATION
- #include "libs/enet/include/enet.h"
- #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();
- }
- }
|