Example #1
0
bool NetworkInitialize()
{
    gs_NetworkAllocator = AllocatorCreateHeap(AllocatorGetHeap());
    AllocatorSetGroup(gs_NetworkAllocator, "Network");

    ENetCallbacks callbacks;
    callbacks.malloc = enet_custom_malloc;
    callbacks.free = enet_custom_free;

    int ret = enet_initialize_with_callbacks(ENET_VERSION, &callbacks);

    if(ret != 0)
    {
        LogError("Error initializing ENet");
        return false;
    }

    LogInfo("Initialized ENet %d.%d.%d networking layer",
            ENET_VERSION_MAJOR, ENET_VERSION_MINOR, ENET_VERSION_PATCH);

    return true;
}
Example #2
0
void InputInitialize()
{
	gs_InputAllocator = AllocatorCreateHeap( AllocatorGetHeap() );
	AllocatorSetGroup(gs_InputAllocator, "Input");
}
Example #3
0
void ResourcesInitialize()
{
	gs_ResourcesAllocator = AllocatorCreateHeap( AllocatorGetHeap() );
	AllocatorSetGroup(gs_ResourcesAllocator, "Resources");
}