Ok, I have what should be a simple problem. BTW I have read many a forum on this issue and either I don't get it or they didn't apply to my case. the rest of the code compiles just fine and the Music file "strawberry.mp3" is within the project, FYI.
ISSUE: I cant get my song to play. Heres my measely code in its totality;
#include "DarkGDK.h"
#include "DarkSDK.h"
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetCameraRange ( 1.0f, 30000.0f );
dbLoadImage ( "texture.jpg", 1 );
dbLoadImage ( "lava.jpg", 2 );
dbSetupTerrain ( );
dbMakeObjectTerrain ( 1 );
dbSetTerrainHeightMap ( 1, "hehehe.jpg" );
dbSetTerrainScale ( 1, 3.0f, 3.5f, 3.0f );
dbSetTerrainLight ( 1, 1.0f, -0.25f, 0.0f, 1.0f, 1.0f, 0.78f, 0.8f );
dbSetTerrainTexture ( 1, 1, 2 );
dbBuildTerrain ( 1 );
double p=1000;//
double b=1050;//added for future quick adjustments to come
double r=1000;//
dbPositionCamera ( p, b, r);
dbSetObjectTexture ( 1, 3, 2 );
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbSetObjectTexture(2, 3,2);
dbScaleObject ( 2, 10000, 10000, 10000 );
dbLoadObject ("Colonel-X.x", 11 );
dbPositionCamera (11,p ,b,r);
dbSetObjectLight (11,1);
dbLoopObject ( 11 );
dbSetObjectSpeed ( 11, 4 );
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
float fCameraAngleZ = 0.0f;
dbLoadMusic ("strawberry.mp3",1);
dbSetMusicVolume ( 1, 8);
dbPlayMusic(1);
dbLoopMusic(1);
while ( LoopGDK ( ) )
{
dbControlCameraUsingArrowKeys ( 0, 2.0f, 2.0f );
while (dbMouseClick() == 1)
{
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.35f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.35f );
fCameraAngleZ = dbWrapValue ( fCameraAngleZ + dbMouseMoveZ ( ) * 0.35f );
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
dbZRotateCamera ( fCameraAngleZ );
dbUpdateTerrain ();
dbSync ( );
dbControlCameraUsingArrowKeys ( 0, 2.0f, 2.0f );
}
dbUpdateTerrain ();
dbSync ( );
float fHeight = dbGetTerrainGroundHeight ( 1,dbCameraPositionX ( ), dbCameraPositionZ ( ) );
dbPositionCamera ( dbCameraPositionX ( ), fHeight + 5.0f, dbCameraPositionZ ( ) );
dbUpdateTerrain ();
dbSync ( );
}
}
If you're not livin', you're already dead!