This commit is contained in:
cozman 2003-10-05 23:44:37 +00:00
parent 21decba405
commit 82d5879949

View File

@ -14,26 +14,27 @@
using namespace ZE; using namespace ZE;
using namespace Gewi; using namespace Gewi;
void Init() bool Initialize()
{ {
ZEngine *ze = ZEngine::GetInstance(); ZEngine *engine = ZEngine::GetInstance();
ZConfigFile cfg("tests.zcf");
ZConfigFile cfg("gewiTest.zcf"); int w,h,bpp,rate;
int w,h,bpp; bool fs;
bool fs; std::string title;
std::string title;
w = cfg.GetInt("ZTimerTest","width",800);
w = cfg.GetInt("screen","width",800); h = cfg.GetInt("ZTimerTest","height",600);
h = cfg.GetInt("screen","height",600); bpp = cfg.GetInt("ZTimerTest","bpp",32);
bpp = cfg.GetInt("screen","bpp",32); fs = cfg.GetBool("ZTimerTest","fullscreen",false);
fs = cfg.GetBool("screen","fullscreen",false); title = cfg.GetString("ZTimerTest","title","Gewi Test");
title = cfg.GetString("screen","title","Gewi Test"); rate = cfg.GetInt("ZTimerTest","framerate",60);
ze->SetupDisplay(w,h,bpp,fs); engine->SetupDisplay(w,h,bpp,fs);
ze->CreateDisplay(title); engine->SetDesiredFramerate(rate);
return engine->CreateDisplay(title);
} }
void Test1() void Test()
{ {
ZEngine *ze = ZEngine::GetInstance(); ZEngine *ze = ZEngine::GetInstance();
GewiEngine *gewi = GewiEngine::GetInstance(); GewiEngine *gewi = GewiEngine::GetInstance();
@ -104,7 +105,6 @@ void Test1()
bg.Draw(0,0); bg.Draw(0,0);
gewi->Display(); //draws everything gewi->Display(); //draws everything
ze->Update(); ze->Update();
} }
} while(!ze->QuitRequested()); } while(!ze->QuitRequested());
@ -113,8 +113,8 @@ void Test1()
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
Init(); if(Initialize())
Test1(); Test();
GewiEngine::ReleaseInstance(); GewiEngine::ReleaseInstance();
ZEngine::ReleaseInstance(); ZEngine::ReleaseInstance();