While trying to help kamac with his problem in this thread
http://forum.thegamecreators.com/?m=forum_view&t=197070&b=41, I discovered something.
The Tier2 Debug library for AppGameKit may be missing stuff that exists in the Release library. (And I made sure that the link paths were using the ones for VS2010.)
I started from a fresh copy of template_vs10 and set the code as follows (some bits are to 'mimic' some of what was in kamac's posted code).
template.h:
#ifndef _H_APP
#define _H_APP
// Link to AGK libraries
#include "agk.h"
#include <vector>
class player {
private:
char pname[512];
public:
player(char* aname) {strcpy(pname,aname);}
~player() {};
};
class Event {
private:
int my_val;
char my_str[512];
UINT my_sprite;
public:
Event(int val)
{
// store the value
my_val=val;
// create a sprite
my_sprite = agk::CreateSprite((UINT)0);
agk::SetSpriteSize(my_sprite,(float)my_val,(float)my_val);
// position on display
agk::SetSpritePosition(my_sprite,(float)my_val,(float)(my_val*2));
agk::SetSpriteVisible(my_sprite,1);
}
~Event()
{
if (agk::GetSpriteExists(my_sprite)) {agk::DeleteSprite(my_sprite);}
}
const char* showMe()
{
sprintf(my_str,"My value is %d",my_val);
return (const char*)my_str;
}
};
// Global values for the app
class app
{
public:
// main vars
int map_sprite[2][100][100];
int map[3][100][100];
int map_id;
char *w_pos;
int w_init;
player *main_player;
std::vector<Event*> my_vec;
public:
// constructor
// REMOVE THE BIT THAT CLEARS IT'S OWN MEMORY!
app() {}
// main app functions
void Begin( void );
void Loop( void );
void End( void );
};
extern app App;
#endif
// Allow us to use the LoadImage function name
#ifdef LoadImage
#undef LoadImage
#endif
template.cpp:
// Includes, namespace and prototypes
#include "template.h"
using namespace AGK;
app App;
// globals
char a_string[1024];
// Begin app, called once at the start
void app::Begin( void )
{
int cnt_start;
int cnt_end;
// get the initial length
cnt_start = (int)my_vec.size();
// add some things
my_vec.push_back(new Event(10));
my_vec.push_back(new Event(15));
// get the final length
cnt_end = (int)my_vec.size();
// show what we did
sprintf(a_string,"Started with %d\nFinished with %d\n",cnt_start,cnt_end);
}
// Main loop, called every frame
void app::Loop ( void )
{
std::vector<Event*>::iterator my_vec_it;
Event* mi;
// print information on screen
agk::Print(a_string);
agk::Print("These are the elements:");
// show the values
for (my_vec_it=my_vec.begin(); my_vec_it<my_vec.end(); my_vec_it++)
{
mi = *my_vec_it;
agk::Print(mi->showMe());
}
agk::Sync ( );
}
// Called when the app ends
void app::End ( void )
{
// clean up
my_vec.clear();
}
The clue that there might be a difference between the two versions of the library, this shows up in the compile log for Debug (and not for Release):
1>AGKWindows.lib(Externs.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(Externs.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(AtlTraceModuleManager.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(AtlTraceModuleManager.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atltypes.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atltypes.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atltrace.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atltrace.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlstr.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlstr.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlimage2.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlimage2.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlimage.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlimage.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(AtlDebugAPI.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(AtlDebugAPI.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlbase.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlbase.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(Allocate.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(Allocate.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(Externs.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(Externs.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(AtlTraceModuleManager.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(AtlTraceModuleManager.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atltypes.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atltypes.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atltrace.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atltrace.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlstr.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlstr.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlimage2.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlimage2.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlimage.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlimage.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(AtlDebugAPI.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(AtlDebugAPI.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(atlbase.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(atlbase.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
1>AGKWindows.lib(Allocate.obj) : warning LNK4099: PDB 'atlsd.pdb' was not found with 'AGKWindows.lib(Allocate.obj)' or at 'C:\TGC\AGK\Projects\TestTemp\Final\atlsd.pdb'; linking object as if no debug info
I know they are just warnings, but, given that the project says to ignore atlsd, they shouldn't show up.
Cheers,
Ancient Lady