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

📄 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 "OgrePagingLandScapePrerequisites.h"
#include "OgreSingleton.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 every time the plug-in need to change the LOD.
*/

class PagingLandScapeRenderableManager : public Singleton<PagingLandScapeRenderableManager>
{
public:

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

	~PagingLandScapeRenderableManager( );

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

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

	/** Set this renderable to be loaded
	*/
    void queueRenderableLoading( PagingLandScapeRenderable *rend, 
                                 PagingLandScapeTile *tile );
	/** Load a set of renderables
	*/
	void executeRenderableLoading(void);

	uint numRenderables( void ) const;
	int numFree( void ) const;
	int numLoading( void ) const;

    
    int PagingLandScapeRenderableManager::numVisibles( void ) 
    {
        return mRenderablesVisibles;
    };
    void resetVisibles (){mRenderablesVisibles = 0;};
    void addVisible (){mRenderablesVisibles ++;};

	static PagingLandScapeRenderableManager& getSingleton(void);

	static PagingLandScapeRenderableManager* getSingletonPtr(void);

protected:

	void _addBatch(const uint num);

	PagingLandScapeIndexBuffer *mIndexes;

	PagingLandScapeRenderableVector mRenderables;

	PagingLandScapeQueue<PagingLandScapeRenderable> mQueue;

	/** Queue to batch the process of loading the Renderables.
		This avoid the plug-in to load a lot of renderables in a single Frame, 
        droping the FPS.
	*/
    PagingLandScapeQueue<PagingLandScapeRenderable> mRenderablesLoadQueue;
    PagingLandScapeQueue<PagingLandScapeTile> mTilesLoadQueue;

    uint mRenderablesVisibles;
	uint mNumRenderables;

};

}

#endif

⌨️ 快捷键说明

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