From 82d587994934c5b2407ec100b101b83936a2b5c4 Mon Sep 17 00:00:00 2001 From: cozman Date: Sun, 5 Oct 2003 23:44:37 +0000 Subject: [PATCH] updated --- test/gewiTest00.cpp | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/test/gewiTest00.cpp b/test/gewiTest00.cpp index 3369299..9b6d689 100755 --- a/test/gewiTest00.cpp +++ b/test/gewiTest00.cpp @@ -14,26 +14,27 @@ using namespace ZE; using namespace Gewi; -void Init() -{ - ZEngine *ze = ZEngine::GetInstance(); - - ZConfigFile cfg("gewiTest.zcf"); - int w,h,bpp; - bool fs; - std::string title; - - w = cfg.GetInt("screen","width",800); - h = cfg.GetInt("screen","height",600); - bpp = cfg.GetInt("screen","bpp",32); - fs = cfg.GetBool("screen","fullscreen",false); - title = cfg.GetString("screen","title","Gewi Test"); - - ze->SetupDisplay(w,h,bpp,fs); - ze->CreateDisplay(title); +bool Initialize() +{ + ZEngine *engine = ZEngine::GetInstance(); + ZConfigFile cfg("tests.zcf"); + int w,h,bpp,rate; + bool fs; + std::string title; + + w = cfg.GetInt("ZTimerTest","width",800); + h = cfg.GetInt("ZTimerTest","height",600); + bpp = cfg.GetInt("ZTimerTest","bpp",32); + fs = cfg.GetBool("ZTimerTest","fullscreen",false); + title = cfg.GetString("ZTimerTest","title","Gewi Test"); + rate = cfg.GetInt("ZTimerTest","framerate",60); + + engine->SetupDisplay(w,h,bpp,fs); + engine->SetDesiredFramerate(rate); + return engine->CreateDisplay(title); } -void Test1() +void Test() { ZEngine *ze = ZEngine::GetInstance(); GewiEngine *gewi = GewiEngine::GetInstance(); @@ -104,7 +105,6 @@ void Test1() bg.Draw(0,0); gewi->Display(); //draws everything ze->Update(); - } } while(!ze->QuitRequested()); @@ -113,8 +113,8 @@ void Test1() int main(int argc, char *argv[]) { - Init(); - Test1(); + if(Initialize()) + Test(); GewiEngine::ReleaseInstance(); ZEngine::ReleaseInstance();