Ok....I have a Solution with both Projects - FoundationClasses and Gameclasses. (Note I mention the DarkAI header below but its not required - is not used yet... haven't got that far
)
(I Updated the Project Files - just a couple source code fixes - AND download only 7 megs now
http://code.google.com/p/darkgdkoop/downloads/list)
I do somethings I'm not sure I should - but here it is:
FIRST:
sc_collision.h and
DarkPhysics.h and
DarkAI.h are all in my
C:/Program Files/The Game Creators/Dark GDK/Include directory.
SECOND:
SC_Collision.lib and
DarkPhysics.lib and
DarkAI.lib are in my
C:/Program Files/The Game Creators/Dark GDK/Lib/vs9 Directory.
----SOLUTION PROPERTIES
Has Two Projects:
FoundationClasses and
GameClasses
I right click the solution, and select properties to get here. In the form that comes up - I also set the "CURRENT SELECT" radio button - so whatever project I have "Highlighted" in the solution explorer is the one I'm compiling/running.
----FOUNDATION CLASSES - Project Properties (Debug one)
I started with a DarkGDK Wizard, then demoted the default main.cpp and added my own MAIN...usually those test programs... named like test_whatever.cpp. I "Add Existing" or "Remove" (without deleting) when I want to change what app I want to play with so I avoid having a ton of projects to configure
When you right-click the FoundationClasses project in the solution explorer, you get the config dialog. In the left is a little tree control.. I navigate to
Configuration Properties->C/C++->Additional Include Directories and my Additional Includes is blank!
I navigate to
Configuration Properties->Linker->Input and my additional Dependancies is Blank!
(Foundation Classes Don't need anything DarkGDK blah blah - its just C++ code to use as a stepping stone for task I need all the time.)
--------GameClasses - Project Properties (Debug one)
I started with a DarkGDK Wizard, then demoted the default main.cpp and added my own MAIN...usually those test programs... named like test_whatever.cpp. I "Add Existing" or "Remove" (without deleting) when I want to change what app I want to play with so I avoid having a ton of projects to configure
I know I said this above - but it applies here too
When you right-click the GameClasses project in the solution explorer, you get the config dialog. In the left is a little tree control.. I navigate to
Configuration Properties->C/C++->Additional Include Directories and my Additional Includes Refers to where the FoundationClasses project is! I've been Told I should have used relative paths - and I should have - this might be one issue. I have:
D:/files/code/CPP/Projects/JegasLLC/FoundationClasses but thats a full path obviously. I think:
..FoundationClasses might do ya just fine!
I navigate to
Configuration Properties->Linker->Input and my additional Dependancies is:
DarkPhysics.lib with NO Path information (I think the DarkGDK stuff is in the "Search for uincludes here" list in Vs2008.) I'll eventually need to add Sparky reference here when I actually have sparky code in use in a demo or game or make references to it.
Does this Help? If not - I can set up a "Remote Session" and look at your screen and see if we can't get it to work. Note - in a worst case scenario I follow these steps after:
Make a new Solution + Project named FoundationClasses using the DarkGDK wizard - compile and run. Does it Work? good! Copy all the foundationclasses *.cpp and *.h files to that directory where the main.cpp was just created. Remove main.cpp and add the
test_foundationclasses.cpp to the project. Compile and run ... work? good!
Add a new Project to the solution named GameClasses using the DarkGDK Wizard again. compile it, run it ...work? Good... DarkGDK configured properly. Add the media directory I suppied to the directory where your new main.cpp was created for this new project. Now toos all the gameclasses *.cpp and *.h files to that directory also. remove the default main.cpp, and add one of the test apps I made. I recommend the Test_Bitmapfont.cpp one first. (No Physics etc - though if you don't have DarkPhysics it might not compile due to references etc)...any way - now you must set up this project properties like I said mine were above... especially the added include directory to point to foundationclasses' directory.
Now the weird part. You need to "Add Existing Files" to GameClasses. all the source code in the foundation classes needs to be added (not copied etc... added to the project.. find them in the FoundationClass' dir.)
[edit]
Before you can run test_bitmapfonts.cpp!!! I was going through this after I posted to be certain - and found something I overlooked. ONE Directory Path
Change test_bitmapfonts.cpp line 57 from:
JGC::BitmapFontArray->AppendItem_SpriteFont("media/Led Green.png",10,10);
to
JGC::BitmapFontArray->AppendItem_SpriteFont("media/fonts/Led Green.png",10,10);
(fonts directory didn't exist when it was written.) You can also just download the latest - link in top of THIS post.
Issues and Fixes Located here:
http://code.google.com/p/darkgdkoop/issues/list
[/edit]
Now ...as they say in the streets... "RUN IT"
test_bitmapfonts.cpp
test_frustrumculling_basic.cpp (After replacing the stock test_frustrumculling_basic.cpp file with this (sorry I'm human):
/*============================================================================
| _________ _______ _______ ______ _______ Jegas, LLC |
| /___ ___// _____/ / _____/ / __ / / _____/ JasonPSage@jegas.com |
| / / / /__ / / ___ / /_/ / / /____ |
| / / / ____/ / / / / / __ / /____ / |
|____/ / / /___ / /__/ / / / / / _____/ / |
/_____/ /______/ /______/ /_/ /_/ /______/ |
| Under the Hood |
==============================================================================
Copyright(c)2008 Jegas, LLC
============================================================================*/
#include <windows.h>
#include <DarkGDK.h>
#include <DarkPhysics.h>
#include <SC_Collision.h>
#include <jfc_common.h>
#include <jfc_string.h>
#include <jfc_ar.h>
#include "jgc_gdk.h"
#include "jgc_common.h"
#include "jgc_vector.h"
#include "jgc_camera.h"
#include "jgc_timer.h"
#include "jgc_object.h"
#include "jgc_image.h"
#include "jgc_bitmap.h"
#include "jgc_light.h"
#include "jgc_clock.h"
#include "jgc_display.h"
#include "jgc_music.h"
#include "jgc_sound.h"
#include "jgc_memblock.h"
#include "jgc_mesh.h"
#include "jgc_matrix.h"
#include "jgc_sprite.h"
#include "jgc_bitmapfonts.h"
#include "jgc_frustrumculling.h"
#include "jgc_darkphysics.h"
//============================================================================
//============================================================================
//============================================================================
//============================================================================
//============================================================================
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
using namespace JFC;
//----------------------------------------------------------------------------
void DarkGDK ( void ){
//----------------------------------------------------------------------------
//JGC::Init();
JGC::Daddy = new JGC_DADDY();
JGC::Display->Window_Set(true);
JGC::Display->Window_Position(0,0);
JGC::Display->DisplayMode_Set(1024,768,32);
//JGC::CameraArray->BackdropColor_Set(0);
JGC_OBJECT *o=new JGC_OBJECT();
//o->Load("huey.x");
//o->Scale(10,10,10);
//o->PitchUp(90);
//dbSaveObject("D:/files/code/CPP/Projects/JegasLLC/GameClasses/HueySmaller.dbo",o->ID);
//_exit(0);
dbPhySetGravity(0,0,0);
JGC_CULL *Cull = new JGC_CULL();
JGC::Cull->ShowBox=true;
//Cull->ShowCube=true;
//Cull->ShowSphere=true;
JGC::Cull->ShowObjectPrimitives=false;
int i;int id1;
for(i=0;i<50;i++){
o=new JGC_OBJECT();
if(i==0){
//o->Clone(6000);
o->Load("media/models/huey.x");
//o->PitchUp(90);
//o->FixObjectPivot();
o->Scale(10,10,10,true);
id1=o->ID;
}else{
dbCloneObject(o->ID,id1);
};
o->Position(dbRnd(200),dbRnd(200),dbRnd(200));
JGC::Cull->Setup_Cull_Obj(o,cnCullType_Object,cnCullMode_Box);
dbPhyMakeRigidBodyDynamicBox(o->ID);
//dbPhyMakeRigidBodyDynamicMesh(o->ID);
dbSetObjectSpeed(o->ID,200000);
dbLoopObject(o->ID);
o->PitchUp(90);
//dbPhyMakeRigidBodyDynamicMesh(o->ID);
//dbPhySetRigidBodyRotation(o->ID,-90,0,0);
};
bool bFirstTime = true;
dbMakeObjectCube(500,50);
dbPhyMakeRigidBodyDynamicBox(500);
while ( LoopGDK ( ) ){
dbSetCursor(0,0);
sprintf(JFC::CHAR1K,"Fps: %i",dbScreenFPS()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Poly: %i",dbStatistic(1)); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"CamX: %f",dbCameraPositionX()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"CamY: %f",dbCameraPositionY()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"CamZ: %f",dbCameraPositionZ()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"CamXA: %f",dbCameraAngleX()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"CamYA: %f",dbCameraAngleY()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"CamZA: %f",dbCameraAngleZ()); dbPrint(JFC::CHAR1K);
/*
sprintf(JFC::CHAR1K,"Heli 0 Position X: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->PositionX_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Position Y: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->PositionY_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Position Z: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->PositionZ_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 ColCenter X: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->CollisionCenterX_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 ColCenter Y: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->CollisionCenterY_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 ColCenter Z: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->CollisionCenterZ_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Center X: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Center->X); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Center Y: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Center->Y); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Center Z: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Center->Z); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Angle X: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->AngleX_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Angle Y: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->AngleY_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Heli 0 Angle Z: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Obj->AngleZ_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 Position X: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->PositionX_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 Position Y: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->PositionY_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 Position Z: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->PositionZ_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 ColCenter X: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->CollisionCenterX_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 ColCenter Y: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->CollisionCenterY_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 ColCenter Z: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->CollisionCenterZ_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 Angle X: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->AngleX_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 Angle Y: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->AngleY_Get()); dbPrint(JFC::CHAR1K);
sprintf(JFC::CHAR1K,"Box 0 Angle Z: %f", ((JGC_CULLNODE*)Cull->Node->ar[0])->Box->AngleZ_Get()); dbPrint(JFC::CHAR1K);
*/
if(dbKeyState(cnScanCode_W)){
dbMoveCamera(1);
};
if(dbKeyState(cnScanCode_S)){
dbMoveCamera(-1);
};
dbPitchCameraUp(0-dbMouseMoveY());
dbTurnCameraLeft(0-dbMouseMoveX());
dbPhySetRigidBodyPosition(500,dbCameraPositionX(),dbCameraPositionY(),dbCameraPositionZ());
JGC::Daddy->Update();
};
};
//----------------------------------------------------------------------------
http://www.jasonpetersage.com/darkgdkoop/darkgdkopp02frustrumculling_basic.PNG
test_frustrum_regions.cpp
(far Away View - Ignore the Supersized beach bug - its the Secret BOSS on level 4 LOL ) Note: The Billboarding "Point to cam" stuff is toggleable and you can set what axis (x,y, or z ...any combination) will point to camera - and of course distances for each of the (three maximum) LOD levels.
http://www.jasonpetersage.com/darkgdkoop/darkgdkopp03frustrum_regions.PNG
(close up - to show LOD)
http://www.jasonpetersage.com/darkgdkoop/darkgdkopp04frustrum_regions.PNG