I bought and downloaded Dark Lights and I can't even get the examples to compile. Here is one of them:
// Dark GDK - The Game Creators - www.thegamecreators.com
// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"
#include "DarkLights.h"
// the main entry point for the application is this function
void DarkGDK ( void )
{
int radiosity = 1;
dbSyncOn ( );
dbSyncRate ( 60 );
dbSetCameraRange ( 1, 1000 );
dbAutoCamOff ( );
dbColorBackdrop ( 0 );
dbSetTextFont ( "Verdana" );
dbSetTextSize ( 14 );
LMStart ( );
// make a floor and 4 spheres
dbMakeObjectBox ( 1,100,1,100 );
dbMakeObjectSphere ( 2,10 );
dbPositionObject ( 1,0,-0.5,0 );
dbPositionObject ( 2,0,10,-10 );
// add level as collision objects to cast shadows
LMAddCollisionObject ( 1 );
LMAddCollisionObject ( 2 );
LMBuildCollisionData ( );
// creates a negative colour light, it will remove light from places it hits instead of adding light
LMAddPointLight ( 0,20,-20,300,-1.0,-1.0,-1.0 );
dbMakeObjectSphere ( 100,1.0 );
dbPositionObject ( 100,0,20,-20 );
// set the ambient light to white to give the shadow light something to remove
LMSetAmbientLight ( 1.0,1.0,1.0 );
// add level as a light map object to receive lightmaps
LMAddLightMapObject ( 1 );
LMAddLightMapObject ( 2 );
int iStartTimer = dbTimer ( );
LMBuildLightMapsThread ( 1024, 4, 1 );
while ( LMGetComplete ( ) == 0 )
{
dbSetCursor ( 0, 0 );
dbPrint ( LMGetStatus ( ) );
dbPrintC ( LMGetPercent ( ) );
dbPrint ( "%" );
dbSync ( );
dbSleep ( 100 );
}
int iEndTimer = dbTimer ( );
LMReset ( );
dbPositionCamera ( 0,50,-50 );
dbPointCamera ( 0,0,0 );
int f1Timer = 0;
int f1Pressed = 0;
float fSpeed = 1.0f;
// our main loop
while ( LoopGDK ( ) )
{
if ( dbKeyState ( 59 ) == 1 && f1Timer < dbTimer ( ) )
{
f1Timer = dbTimer ( ) + 300;
f1Pressed = 1 - f1Pressed;
}
dbSetCursor ( 0, 0 );
if ( f1Pressed == 0 )
{
dbCenterText ( dbScreenWidth ( ) / 2.0, 20, "-- Press F1 For Help --" );
}
else
{
dbPrint ( "Use Arrows Keys to Move" );
dbPrint ( "" );
dbPrintC ( "FPS: " );
dbPrint ( ( LONGLONG ) dbScreenFPS ( ) );
dbPrintC ( "Build Time: " );
dbPrint ( ( iEndTimer - iStartTimer ) / 1000.0 );
}
if ( dbUpKey ( ) )
dbMoveCamera ( 1 );
if ( dbDownKey ( ) )
dbMoveCamera ( -1 );
// update the screen
dbSync ( );
}
// return back to windows
return;
}
It's EXACTLY from the example and here is the output:
1>------ Build started: Project: Bloom, Configuration: Release Win32 ------
1>Compiling...
1>Main.cpp
1>Linking...
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMReset(void)" (?LMReset@@YAXXZ) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "float __cdecl LMGetPercent(void)" (?LMGetPercent@@YAMXZ) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "char * __cdecl LMGetStatus(void)" (?LMGetStatus@@YAPADXZ) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "int __cdecl LMGetComplete(void)" (?LMGetComplete@@YAHXZ) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMBuildLightMapsThread(int,float,int)" (?LMBuildLightMapsThread@@YAXHMH@Z) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMAddLightMapObject(int)" (?LMAddLightMapObject@@YAXH@Z) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMSetAmbientLight(float,float,float)" (?LMSetAmbientLight@@YAXMMM@Z) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMAddPointLight(float,float,float,float,float,float,float)" (?LMAddPointLight@@YAXMMMMMMM@Z) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMBuildCollisionData(void)" (?LMBuildCollisionData@@YAXXZ) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMAddCollisionObject(int)" (?LMAddCollisionObject@@YAXH@Z) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "void __cdecl LMStart(void)" (?LMStart@@YAXXZ) referenced in function "void __cdecl DarkGDK(void)" (?DarkGDK@@YAXXZ)
1>Release\Bloom.exe : fatal error LNK1120: 11 unresolved externals
1>Build log was saved at "file://c:\Bloom\Release\BuildLog.htm"
1>Bloom - 12 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What's wrong?
EDIT: Figured it out. I had to add DarkLights.lib as a dependency in Properties->Linker->Input->Additional Dependancies
The fastest code is the code never written.