Fixed DLL support for physics Engine

.. hopefully
This commit is contained in:
Dander7BD 2013-11-25 11:47:42 +01:00
parent d33d1f41bc
commit 4072bf50fb
4 changed files with 30 additions and 5 deletions

View File

@ -0,0 +1,11 @@
#define NOMINMAX
#include <windows.h>
#include "OysterMath.h"
BOOL WINAPI DllMain( _In_ HINSTANCE hinstDLL,
_In_ DWORD fdwReason,
_In_ LPVOID lpvReserved )
{
return ::Oyster::Math::IsSupported();
}

View File

@ -90,6 +90,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -100,6 +101,7 @@
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -112,6 +114,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -126,6 +129,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_WINDLL;DLL_EXPORT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
@ -153,6 +157,7 @@
<ClCompile Include="Implementation\NullBody.cpp" />
<ClCompile Include="Implementation\PhysicsAPI_Impl.cpp" />
<ClCompile Include="Implementation\SimpleRigidBody.cpp" />
<ClCompile Include="DLLMain.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -41,5 +41,8 @@
<ClCompile Include="Implementation\NullBody.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="DLLMain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@ -4,6 +4,12 @@
#include "OysterCollision3D.h"
#include "OysterMath.h"
#if defined DLL_EXPORT
#define DLL_USAGE __declspec(dllexport)
#else
#define DLL_USAGE __declspec(dllimport)
#endif
namespace Oyster
{
namespace Physics
@ -22,7 +28,7 @@ namespace Oyster
const float gravity_constant = (const float)6.67284e-11; //!< The _big_G_! ( N(m/kg)^2 ) Used in real gravityforcefields.
}
class MomentOfInertia
class DLL_USAGE MomentOfInertia
{
public:
static ::Oyster::Math::Float4x4 & CreateSphereMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float radius);
@ -36,7 +42,7 @@ namespace Oyster
static ::Oyster::Math::Float4x4 & CreateRodMatrix( const ::Oyster::Math::Float mass, const ::Oyster::Math::Float length );
};
class API
class DLL_USAGE API
{
public:
typedef void (*EventAction_Collision)( unsigned int, unsigned int );
@ -200,8 +206,8 @@ namespace Oyster
virtual ~API() {}
};
//! sdfsdf
class ICustomBody
//! documentation in progress
class DLL_USAGE ICustomBody
{
public:
virtual ~ICustomBody() {};
@ -237,7 +243,7 @@ namespace Oyster
namespace Error
{ //! The content in here is used as API return errorvalues.
class NullBody : public ICustomBody
class DLL_USAGE NullBody : public ICustomBody
{
public:
virtual ~NullBody();