Beispiel #1
0
        void initialize(ApplicationBase* _app){
            app = _app;
            //Load all resources
            rsrc1 = _app->_ResourceManager->LoadResource("spr1.png","spr1");
            rsrc2 = _app->_ResourceManager->LoadResource("spr3.png","spr2");
            rsrc3 = _app->_ResourceManager->LoadResource("ts_01.png","ts_01");
            rsrc4 = _app->_ResourceManager->LoadResource("spr2.png","spr3");
            //Get surface data from resources
            Log("rsrc1 = %i", rsrc1);
            Log("Rsrc1.size() = %i", rsrc1->GetSize());
            spr1 = rsrc1->GetData();
            spr2 = rsrc2->GetData();
            spr3 = rsrc3->GetData();
            spr4 = rsrc4->GetData();
            //Get Resources here
            wrldTs = (*_app->_ResourceManager)["ts_01"];
            SET_TLBR(gAnims[0],0.0f,0.0f,1.0f,1.0f);
            SET_TLBR(gAnims[1],0.0f,0.0f,1.0f,1.0f);
            gAnims[0].pSurf = spr1;
            gAnims[1].pSurf = spr2;
            gAnims[0].fAnimSpeed = 1.0f;
            gAnims[1].fAnimSpeed = 1.0f;
            gAnims[0].lpNext = &gAnims[1];
            gAnims[1].lpNext = &gAnims[0];
            sprAnim.setAnimation(&gAnims[0]);
            sprAnim.setGraphics(_app->_Graphics);
			entity.SetPos(32,32);
            entity.SetSurface(spr4);
            Log("Memory Usage: %f MBytes", ((float)_app->_ResourceManager->GetMemoryUsage())/(1024.0f*1024.0f));
        };
Beispiel #2
0
 void render()
 {
     app->_Graphics->DrawSurfaceAlpha(0,0,Logo->GetData(), (fadeValue*_elapsedTime)/INTRO_TIME);
     app->_Graphics->DrawString(0,0,"Time Left: %i MS",INTRO_TIME - _elapsedTime);
     app->_Graphics->DrawLine(0,0,32,32);
    // render our background, etc.
 }
Beispiel #3
0
 void render(){
     app->_GameWorld->DrawWorld((GfxSurface)wrldTs->GetData());
     sprAnim.update(app->_System->getFrameTime());
     sprAnim.drawCurrentFrame(128,128);
     entity.Draw(app->_Graphics);
     app->_Graphics->DrawString(0,0,"FPS: %i",(int)app->_System->FPS());
     app->_Graphics->DrawString(32,32,"Hello SGE World!\nTesting Multiline Strings");
     app->_Graphics->DrawLine(0,0,64,32);
 };