Site hosted by Angelfire.com: Build your free website today!


sample.h
Links

Crystal Space

Crystal Space Tutorial Site

QuArK

polycount

Sample Code

mysimple.h
mysimple.cpp
mysimple.zip

Sample Code

mysimple.h
mysimple.cpp
mysimple.zip



/*
    Copyright (C) 2002 by M. Kohel
*/

#ifndef __SIMPMAP_H__
#define __SIMPMAP_H__

#include <stdarg.h>
#include "csutil/csdllist.h"

class  csDLinkList;
struct csDLListItem;

struct iEngine;
struct iLoader;
struct iGraphics3D;
struct iKeyboardDriver;
struct iVirtualClock;
struct iObjectRegistry;
struct iEvent;
struct iSector;
struct iView;

//added for collision detection
struct iCollider;
struct iCollideSystem;
struct iMeshWrapper;
struct iMeshList;

class Simple
{
private:
  iObjectRegistry * object_reg;
  iEngine         * engine;
  iLoader         * loader;
  iGraphics3D     * g3d;
  iKeyboardDriver * kbd;
  iVirtualClock   * vc;
  iSector         * room;
  iView           * view;
  bool              forward;
  //next few  lines added for collision detection
  iCollideSystem  * cdsys;
  iMeshWrapper    * sprite1;
  iMeshWrapper    * sprite2;
  iMeshWrapper    * sprite3;
  iMeshWrapper    * mesh_in_sector;
  iCollider       * npc_collide1;
  iCollider       * npc_collide2;
  iCollider       * npc_collide3;
  iCollider       * mesh_collider;
  iMeshList       * mesh_list;

  static bool SimpleEventHandler (iEvent& ev);
  bool HandleEvent (iEvent& ev);
  void SetupFrame ();
  void FinishFrame ();
  bool LoadMap ();
  iCollider* InitCollider (iMeshWrapper* mesh);

public:
  Simple ();
  ~Simple ();

  bool Initialize (int argc, const char* const argv[]);
  void Start ();
};

#endif // __SIMPMAP_H__