view Renderer/Test/SgRootChange.cc @ 656:d0b8860c17f8

remove global variable "sgroot" , add SgChange.{cc, h} SgMain.cc SgRootChange.{cc, h}
author hiroki@henri.cr.ie.u-ryukyu.ac.jp
date Wed, 25 Nov 2009 21:56:14 +0900
parents
children 9d1bcc07734b b7376415fa5f
line wrap: on
line source

#include <math.h>
#include <stdlib.h>
#include "SceneGraphRoot.h"
#include "MainLoop.h"
#include "SgRootChange.h"




// prototype
MainLoopPtr 
SgRootChange::init(Viewer *sgroot, int screen_w, int screen_h)
{
    return sgroot;
}

MainLoopPtr 
SgRootChange::init_only_sg(SgChange *sgroot, int screen_w, int screen_h)
{
    SceneGraphPtr ball;
    SceneGraphPtr cube;
    SceneGraphRoot *sg_buff_A = sgroot->sgroot_A;
    SceneGraphRoot *sg_buff_B = sgroot->sgroot_B;

    sg_buff_A->createFromXMLfile(sgroot->manager, "xml_file/Ball.xml");
    sg_buff_B->createFromXMLfile(sgroot->manager, "xml_file/cube.xml");

    ball = sgroot->sgroot_A->createSceneGraph("Ball");
    cube = sgroot->sgroot_B->createSceneGraph("Cube");

    sgroot->sgroot_A->setSceneData(ball);
    sgroot->sgroot_B->setSceneData(cube);

    return sgroot;
}

extern Application *
application() {
    return new SgRootChange();
}

const char *usr_help_str = "Usage: ./test_nogl [OPTION]\n";

extern int sg_init(TaskManager *manager, int argc, char *argv[]);
extern void task_initialize();
static void TMend(TaskManager *manager);

int
TMmain(TaskManager *manager, int argc, char *argv[])
{
    task_initialize();
    manager->set_TMend(TMend);
    return sg_init(manager, argc, argv);

}

void
TMend(TaskManager *manager)
{
    printf("test_nogl end\n");
}

/* end */