#include "game.h"
TestGame::TestGame() {
}
TestGame::~TestGame() {
}
bool TestGame::OnInit() {
_clearScreen = true;
return true;
}
void TestGame::OnFrame() {
if (KeyDown(DIK_ESCAPE))
PostQuitMessage(0);
}
void TestGame::OnDraw() {
wstringstream ss;
ss << ZAK_ENGINE_NAME << endl << "FPS: " << _fpsMeter.GetFps() << endl;
g_renderer.SetFontColor(0xFFFF0000);
g_renderer.DrawString(ss.str(),10,10,800-20,600-20,ZAK_TEXT_LEFT);
}
bool TestGame::OnShutdown() {
return true;
}
#include "game.h"
using namespace zak;
#ifdef USING_DIRECTX81
#ifdef _DEBUG
#pragma comment (lib, "zakengine81d.lib")
#else
#pragma comment (lib, "zakengine81.lib")
#endif
#else
#ifdef _DEBUG
#pragma comment (lib, "zakengined.lib")
#else
#pragma comment (lib, "zakengine.lib")
#endif
#endif
int main () {
string desc;
TestGame game;
GameConfig config;
if (!config.Load("config.ini"))
return false;
if (game.StartUp(&config)) {
game.Loop();
} else {
game.Shutdown();
MessageBoxA(g_window.GetHWnd(),Log.GetLastMessage(),"Error",MB_ICONERROR|MB_OK);
return 1;
}
if (!game.Shutdown()) {
MessageBoxA(g_window.GetHWnd(),Log.GetLastMessage(),"Error",MB_ICONERROR|MB_OK);
return 1;
}
return 0;
}