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

📄 ogrepaginglandscaperenderablemanager.h

📁 使用stl技术,(还没看,是听说的)
💻 H
字号:
/***************************************************************************
  OgrePagingLandScapeRenderableManager.h  -  description
  -------------------
	begin                : Mon Jun 16 2003
	copyright            : (C) 2003 by Jose A Milan
	email                : spoke2@supercable.es
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU Lesser General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PAGINGLANDSCAPERENDERABLEMANAGER_H
#define PAGINGLANDSCAPERENDERABLEMANAGER_H

#include <vector>
#include <OgreSingleton.h>

#include "OgrePagingLandScapeIndexBuffer.h"
#include "OgrePagingLandScapeRenderable.h"
#include "OgrePagingLandScapeQueue.h"

namespace Ogre
{

/** Class to manage the creation, destruction and use of PagingLandScapeRenderables.
	@remarks
		This class is used as a store of PagingLandScapeRenderables and the are reference and dereference in order to not being created and
		destroyed everytime the plugin need to change the LOD.
  */

class PagingLandScapeRenderableManager : public Singleton<PagingLandScapeRenderableManager>
{
public:

	typedef std::vector< PagingLandScapeRenderable* > PagingLandScapeRenderableVector;

	/** Initializes the PagingLandScapeRenderableManager with the given options and reserve the necesary memory.
	*/
	PagingLandScapeRenderableManager( );

	~PagingLandScapeRenderableManager( );

	void updateCache( void );

	/** Retrieve a free renderable.
	*/
	PagingLandScapeRenderable *getRenderable( );

	/** Make a renderable free.
	*/
	void freeRenderable( PagingLandScapeRenderable *rend );

	int numFree( void ) const;

	/** Make a renderable Morph between LOD.
	*/
	void Morph( void );

	void DeMorph( void );

	void needMorph( PagingLandScapeRenderable *rend );

	void needDeMorph( PagingLandScapeRenderable *rend );

	int numMorph( void ) const;

	int numDeMorph( void ) const;

	/** Override standard Singleton retrieval.
		@remarks
			Why do we do this? Well, it's because the Singleton implementation is in a .h file,
			which means it gets compiled into anybody who includes it. This is needed for the Singleton
			template to work, but we actually only want it compiled into the implementation of the
			class based on the Singleton, not all of them. If we don't change this, we get link errors
			when trying to use the Singleton-based class from an outside dll.
		@par
			This method just delegates to the template version anyway, but the implementation stays in this
			single compilation unit, preventing link errors.
	*/
	static PagingLandScapeRenderableManager& getSingleton(void);

protected:

	PagingLandScapeIndexBuffer *mIndexes;

	PagingLandScapeRenderableVector mRenderables;

	PagingLandScapeQueue<PagingLandScapeRenderable> mQueue;
	PagingLandScapeQueue<PagingLandScapeRenderable> mMorphQueue;
	PagingLandScapeQueue<PagingLandScapeRenderable> mDeMorphQueue;

	int NumRenderables;
	int NumRenderablesMorphProcess;
	int NumRenderablesDeMorphProcess;

};

}

#endif

⌨️ 快捷键说明

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