view Renderer/DataPack/DataPackEngine.cpp @ 0:df32980116bd

Initial revision
author gongo
date Sat, 02 Feb 2008 19:15:39 +0900
parents
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();
    }
}