Show dll.cpp syntax highlighted
/***************************************************************************
dll.cpp - Dynamic library entry points and init/shutdown
-------------------
begin : Tue Jul 8 2003
copyright : (C) 2003 by Reality Rift Studios
email : mattias@realityrift.com
***************************************************************************
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is the NeoEngine, NeoABT, dll.cpp
The Initial Developer of the Original Code is Mattias Jansson.
Portions created by Mattias Jansson are Copyright (C) 2003
Reality Rift Studios. All Rights Reserved.
***************************************************************************/
#include "base.h"
#include "room.h"
#include "link.h"
#include <neoengine/module.h>
#ifdef HAVE_NEOCHUNKIO
# include "chunk.h"
# include <neochunkio/factory.h>
#endif
using namespace NeoEngine;
using namespace NeoChunkIO;
using namespace NeoABT;
namespace NeoABT
{
ModuleStatic *g_pkStaticModule = 0;
NEOABT_API int Initialize()
{
#ifdef HAVE_NEOCHUNKIO
ChunkFactory::RegisterChunkType( ABTChunkType::ABTROOM, "abt", ABTRoomChunk::Allocator );
ChunkFactory::RegisterChunkType( ABTChunkType::ABTGEOM, "abtgeom", ABTGeometryChunk::Allocator );
#endif
return 0;
}
NEOABT_API NeoEngine::Room *CreateRoom()
{
return new NeoABT::ABTRoom;
}
NEOABT_API int Shutdown()
{
delete g_pkStaticModule;
return 0;
}
NEOABT_API void GetVersion( std::string *pstrName, int *piMajor, int *piMinor, int *piRevision )
{
*pstrName = "Adaptive Binary Tree";
*piMajor = NEOABTVERSION_MAJOR;
*piMinor = NEOABTVERSION_MINOR;
*piRevision = NEOABTVERSION_REVISION;
}
Link::Link()
{
#if defined(WIN32) && defined(_DEBUG)
g_pkStaticModule = new ModuleStatic( "neoabt_debug" );
#else
g_pkStaticModule = new ModuleStatic( "neoabt" );
#endif
g_pkStaticModule->m_Symbols.Insert( "CreateRoom", (void**)CreateRoom );
g_pkStaticModule->m_Symbols.Insert( "Initialize", (void**)Initialize );
g_pkStaticModule->m_Symbols.Insert( "Shutdown", (void**)Shutdown );
g_pkStaticModule->m_Symbols.Insert( "GetVersion", (void**)GetVersion );
NeoEngine::Core::GetModuleManager()->InsertModule( g_pkStaticModule );
}
};
See more files for this project here