view dandy.cc @ 4:e089ac9ea221

greenclab add. not complete...
author tkaito
date Sun, 06 Jun 2010 06:47:45 +0900
parents 69b4108bf4e8
children 581fa1888e2e
line wrap: on
line source

#include <math.h>
#include "SceneGraphRoot.h"
#include "dandy.h"

void
title_idle(SceneGraphPtr node, void *sgroot_, int screen_w, int screen_h)
{

}

MainLoopPtr
dandy::init(Viewer *sgroot, int w, int h)
{
  SceneGraphPtr back, title;

  sgroot->createFromXMLfile("xml/mydandy.xml");
  sgroot->createFromXMLfile("xml/title2.xml");
  sgroot->createFromXMLfile("xml/gameover.xml");
  sgroot->createFromXMLfile("xml/enemy_greenclab.xml");

  
  back  = sgroot->createSceneGraph();
  title = sgroot->createSceneGraph("title001");
  title->xyz[0] = w/2;
  title->xyz[1] = h/2;
  title->set_move_collision(title_idle, title_collision);  
  back->addChild(title);

  sgroot->setSceneData(back);

  //mydandy = sgroot->getSgid("mydandy01");
  //enemy = sgroot->getSgid("ENEMY");
  
  return sgroot;
}

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

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

extern int 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 init(manager, argc, argv);

}

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