Hi everyone and thanks in advance for your help.
I had recently bought dark game studio and the expansion packs and have fallen deeply in love. There are some issuses i'm having tho. It took me a while to get darkPhysics working but it is now, perfectly. I also have shaders working in the same project. This is all great but I wanted to use some of the fullscreen shaders to make my sceen look nice. I've managed to get the Bloom shader working on its own but if I try to use darkPhysics at the same time it wont work and I get the following 3 errors
1>DarkPhysics.lib(EngineProperties.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>shaderdata.lib(shaderdata.obj) : error LNK2005: "int __cdecl GetNumDependencies(void)" (?GetNumDependencies@@YAHXZ) already defined in DarkPhysics.lib(EngineSetup.obj)
1>shaderdata.lib(shaderdata.obj) : error LNK2005: "char const * __cdecl GetDependencyID(int)" (?GetDependencyID@@YAPBDH@Z) already defined in DarkPhysics.lib(EngineSetup.obj)
1> Creating library Debug\Dark GDK - BloomTest.lib and object Debug\Dark GDK - BloomTest.exp
1>Debug\Dark GDK - BloomTest.exe : fatal error LNK1169: one or more multiply defined symbols found
1>Build log was saved at "file://d:\Users\Brightspark\Documents\Visual Studio 2008\Projects\Dark GDK - BloomTest\Dark GDK - BloomTest\Debug\BuildLog.htm"
1>Dark GDK - BloomTest - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Here is the code I'm using to test this problem
// BrightSpark42
//Include Header files
#include "DarkGDK.h"
#include "ShaderData.h"
#include "DarkPhysics.h"
void DarkGDK ( void )
{
// this is the entry point for the program
// switch on sync rate and set the maximum
// refresh rate to 60 frames per second
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetWindowOff ();
dbMaximizeWindow ( );
//Initiate DarkPhysics
//dbPhyStart ( );
dbPhySetSkinWidth ( 0.001 );
// prepare the shader functions
dbShaderDataStart ( );
// make a sphere, load an image and texture it
dbMakeObjectSphere ( 1, 10 );
dbLoadImage ( "detail.jpg", 1 );
dbTextureObject ( 1, 1 );
//dbPositionObject (1,0,0,2);
// switch autocam off
dbAutoCamOff ( );
// make a camera and color the backdrop to 0
dbMakeCamera ( 1 );
dbColorBackdrop ( 1, 0 );
// load an effect for the camera
dbLoadCameraEffect ( "Bloom.dbs", 1, 0 );
dbSetCameraEffect ( 1, 1, 1 );
// make a plane and set the quad effect for it
dbMakeObjectPlane ( 2, 2, 2 );
dbLoadEffect ( "quad.fx", 2, 0 );
dbSetObjectEffect ( 2, 2 );
// set up properties for our quad effect
dbMakeVector4 ( 1 );
dbSetVector4 ( 1, dbScreenWidth ( ), dbScreenHeight ( ), 0, 0 );
dbSetEffectConstantVector ( 2, "ViewSize", 1 );
dbDeleteVector4 ( 1 );
dbTextureObject ( 2, 0, 1 );
// ensure camera 1 is set to same position and rotation as camera 0
dbPositionCamera ( 1, dbCameraPositionX ( 0 ), dbCameraPositionY ( 0 ), dbCameraPositionZ ( 0 ) );
dbRotateCamera ( 1, dbCameraAngleX ( 0 ), dbCameraAngleY ( 0 ), dbCameraAngleZ ( 0 ) );
// main program loop
while ( LoopGDK ( ) )
{
// rotate the sphere
dbTurnObjectLeft ( 1, 0.1 );
// hide the quad, show the sphere and draw
// this camera effect to our quad
dbHideObject ( 2 );
dbShowObject ( 1 );
dbSyncCamera ( 1 );
// hide the sphere, show the quad
dbHideObject ( 1 );
dbShowObject ( 2 );
dbSyncMask( 0x001 );
/// update the screen, camera 1 is shown
dbSync ( );
}
}
It's basically the Bloom sample project with the physics command added. Running this code works but as soon as I uncomment the dbPhysStart() command it doesn't. I've included the DarkPhysics.lib in the additional dependecies and copied the dll files into the project folder. I've attached the project folder aswell if that helps.
I've searched the forums but can't find a solution. I know i'm not the only one with this problem.
BS