view Renderer/DataPack/DataPackEngine.cpp @ 312:57530cb7f7d1

memMain tester
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 08 Jun 2009 23:19:11 +0900
parents df32980116bd
children
line wrap: on
line source

void
DataPackEngine::init(int width, int height, int bpp)
{
    if(SDL_Init( SDL_INIT_VIDEO ) < 0)
    {
	cout << "Couldn't initialize SDL:" << SDL_GetError() << endl;
	exit(1);
    }

    // etc...
}

TaskDepend
DataPackEngine::update_all(SceneGraph* next, SceneGraph* now, TaskDepend wait)
{
    SceneGraph *t, *nt;
    t = now;
    nt = next;

    SceneGraphPack *nt_pack = nt->data_pack();
    SceneGraphPack *t_pack;
    Task* t_task = now->get_task();

    for (t_pack = now->data_pack(); t_pack < not->data_pack;) {
	t_task->update(t_pack, nt_pack);
	t_pack = t_pack->next();
	nt_pack = nt_pack->next();
    }
}

TaskDepend
DataPackEngin::draw_all(SceneGraph* now, TaskDepend wait)
{
    SceneGraph *t, *nt;
    t = now;
    nt = next;

    SceneGraphPack *t_pack;
    Task* t_task = now->get_task();

    for (t_pack = now->data_pack(); t_pack < now->data_pack;) {
	t_task->draw(t_pack, nt_pack);
	t_pack = t_pack->next();
    }
}