Show glue.cpp syntax highlighted
/***************************************************************************
glue.cpp - Export symbols for engine
-------------------
begin : Thu Mar 27 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, NeoDevOpenGL, glue.cpp
The Initial Developer of the Original Code is Mattias Jansson.
Portions created by Mattias Jansson are Copyright (C) 2002
Reality Rift Studios. All Rights Reserved.
***************************************************************************/
#include "device.h"
#include "link.h"
#include <neoengine/module.h>
using namespace NeoEngine;
using namespace NeoOGL;
namespace NeoOGL
{
#define OGLEXPORT
ModuleStatic *g_pkStaticModule = 0;
OGLEXPORT void GetVersion( std::string *pstrName, int *piMajor, int *piMinor, int *piRevision )
{
std::string strDevInfo =
#ifdef WIN32
# ifdef _DEBUG
"OpenGL-Win32 [DEBUG]";
# else
"OpenGL-Win32";
# endif
#elif __APPLE__
# ifdef _DEBUG
"OpenGL-MacOSX [DEBUG]";
# else
"OpenGL-MacOSX";
# endif
#elif POSIX
# ifdef _DEBUG
"OpenGL-POSIX [DEBUG]";
# else
"OpenGL-POSIX";
# endif
#else
# error "Platform not implemented!"
#endif
*pstrName = strDevInfo;
*piMajor = NEOENGINEVERSION_MAJOR;
*piMinor = NEOENGINEVERSION_MINOR;
*piRevision = NEOENGINEVERSION_REVISION;
}
OGLEXPORT int Initialize()
{
return 0;
}
OGLEXPORT int Shutdown()
{
delete g_pkStaticModule;
return 0;
}
OGLEXPORT RenderDevice *CreateDevice( FileManager *pkFileManager, InputManager *pkInputManager )
{
return new Device( pkFileManager, pkInputManager );
}
Link::Link()
{
#if defined(WIN32) && defined(_DEBUG)
g_pkStaticModule = new ModuleStatic( "neodevopengl_debug" );
#else
g_pkStaticModule = new ModuleStatic( "neodevopengl" );
#endif
g_pkStaticModule->m_Symbols.Insert( "GetVersion", (void**)GetVersion );
g_pkStaticModule->m_Symbols.Insert( "Initialize", (void**)Initialize );
g_pkStaticModule->m_Symbols.Insert( "Shutdown", (void**)Shutdown );
g_pkStaticModule->m_Symbols.Insert( "CreateDevice", (void**)CreateDevice );
NeoEngine::Core::GetModuleManager()->InsertModule( g_pkStaticModule );
}
}; // namespace NeoOGL
See more files for this project here