⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo.h

📁 使用stl技术,(还没看,是听说的)
💻 H
字号:
/******************************************************************************

 * This source code is part of Bad Camel Gaming

 * Copyright (C) 2002  Zephie Greyvenstein

 * See Readme.html for acknowledgements

 *

 * This program is free software; you can redistribute it and/or

 * modify it under the terms of the GNU General Public License

 * as published by the Free Software Foundation; either version 2

 * of the License, or (at your option) any later version.

 *

 * This program is distributed in the hope that it will be useful,

 * but WITHOUT ANY WARRANTY; without even the implied warranty of

 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

 * GNU General Public License for more details.

 *

 * You should have received a copy of the GNU General Public License

 * along with this program; if not, write to the Free Software

 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

 *****************************************************************************/



/******************************************************************************

 * FILENAME    : demo.h

 * DESCRIPTION : Main demo controlling class

 * AUTHOR      : Zephie Greyvenstein

 *****************************************************************************/



/// Avoid double inclusion

#ifndef __DEMO_H__

#define __DEMO_H__



#include "collision.h"



/// Include the oasis headers

#include "oasisCommon.h"

#include "oasisRoot.h"

#include "oasisFrameListener.h"

#include "oasisMouseListener.h"

#include "oasisSingleton.h"

#include "oasisScriptSystem.h"

#include "oasisObjectSystem.h"

#include "oasisScriptExtension.h"



#include <iostream>



using namespace Oasis;



/// Sets up the application

class demo : public frameListener,

             public mouseListener,

             public scriptExtension,

             public singleton< demo > {

 public:

  /// Constructor

  demo( );

  /// Deconstructor

  virtual ~demo( );



  /// Get singleton

  static demo &get( void );

  /// Get singleton pointer

  static demo *getPtr( void );



  /// Overload the manager start function

  bool frameStarted( float time );

 

  /// Overload for functionality

  void mouseMoved( const vector3 &moved );

  void mousePressed( const uint8 button, const uint8 count );  

  

  /// Starts the demo

  bool startDemo( Oasis::scriptSystem::Language language );

  

  /// Add a collision listener to an object

  void addReactor( object *subject );



  /// Show help

  void help( void );

  /// Get demo list

  void list( void );

  /// Load a demo

  void load( const string &demoName );

  /// Iterate to the next language.

  void swapLanguage( void );



 protected:

  /// Collision reactor

  collision *reactor;

  /// Make sure we don't respond too quick

  float reactDelay;



  /// Register this class, 

  /// Obsolete. check scripts/ 

  void _registerClass( void );

  

 private:

  //extensions to the current scripting language

  //if it's lua

  void setupLua( );

  //if it's ruby

  void setupRuby( );



};



#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -