view Renderer/Cell/Engine.cpp @ 0:df32980116bd

Initial revision
author gongo
date Sat, 02 Feb 2008 19:15:39 +0900
parents
children
line wrap: on
line source

CellEngine::CellEngine()
{
    TaskManager manager = new TaskManager();
}

void
CellEngine::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
CellEngine::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();
    TaskDepend task;

    task = manager->create_task(function_id, now->task_size(),
			 (unsigned int *)now->get_task(),
			 (unsigned int *)next->get_task());

    manager->set_task_depend(task, wait);

    task->run();

    return task;
}

TaskDepend
CellEngin::draw_all(SceneGraph* now, TaskDepend wait)
{
    /**
     * SceneGraph => Polygon
     * Polygon => Span, Texture
     * Texture, Span => Rendering
     */

    SceneGraph *t, *nt;
    t = now;
    nt = next;

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

    task = manager->create_task(function_id, now->task_size(),
				(unsigned int *)now->get_task(),
				(unsigned int *)next->get_task());

    manager->set_task_depend(task, wait);

    task->run();
}