[59] | 1 | /*
|
---|
| 2 | -----------------------------------------------------------------------------
|
---|
| 3 | This source file is part of OGRE
|
---|
| 4 | (Object-oriented Graphics Rendering Engine)
|
---|
| 5 | For the latest info, see http://www.ogre3d.org/
|
---|
| 6 |
|
---|
| 7 | Copyright © 2000-2002 The OGRE Team
|
---|
| 8 | Also see acknowledgements in Readme.html
|
---|
| 9 |
|
---|
| 10 | This program is free software; you can redistribute it and/or modify it under
|
---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
| 13 | version.
|
---|
| 14 |
|
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
| 18 |
|
---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
| 22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
| 23 | -----------------------------------------------------------------------------
|
---|
| 24 | */
|
---|
| 25 |
|
---|
[1273] | 26 | #include "OgreOcclusionCullingSceneManager.h"
|
---|
| 27 | #include "OgreKdTreeSceneManager.h"
|
---|
| 28 | #include "OgreKdTerrainSceneManager.h"
|
---|
[100] | 29 | #include <OgreRoot.h>
|
---|
[115] | 30 | #include <OgreLogManager.h>
|
---|
[897] | 31 |
|
---|
[74] | 32 | #include "VisibilityManager.h"
|
---|
| 33 | #include "VisibilityEnvironment.h"
|
---|
[897] | 34 |
|
---|
[74] | 35 | GtpVisibility::VisibilityEnvironment *visEnv;
|
---|
| 36 | GtpVisibility::VisibilityManager *visManager;
|
---|
[59] | 37 |
|
---|
| 38 | namespace Ogre {
|
---|
| 39 |
|
---|
[1264] | 40 |
|
---|
[925] | 41 | OcclusionCullingSceneManagerFactory *occlusionCullingPlugin;
|
---|
[1163] | 42 | KdTreeSceneManagerFactory *kdTreeFactory;
|
---|
[1273] | 43 | KdTerrainSceneManagerFactory *kdTerrainFactory;
|
---|
[59] | 44 |
|
---|
| 45 | //-----------------------------------------------------------------------
|
---|
[133] | 46 | extern "C" void __declspec(dllexport) dllStartPlugin(void)
|
---|
[59] | 47 | {
|
---|
[938] | 48 | // load visibility environment
|
---|
[120] | 49 | visEnv = new GtpVisibility::VisibilityEnvironment();
|
---|
[74] | 50 | visManager = new GtpVisibility::VisibilityManager(visEnv);
|
---|
[115] | 51 |
|
---|
[59] | 52 | // Create new scene manager
|
---|
[925] | 53 | occlusionCullingPlugin = new OcclusionCullingSceneManagerFactory(visManager);
|
---|
[1165] | 54 | kdTreeFactory = new KdTreeSceneManagerFactory(visManager);
|
---|
[1273] | 55 | kdTerrainFactory = new KdTerrainSceneManagerFactory(visManager);
|
---|
[897] | 56 | // Construct listener manager singleton
|
---|
| 57 | new TerrainPageSourceListenerManager();
|
---|
[1273] | 58 | new KdTerrainPageSourceListenerManager();
|
---|
[115] | 59 |
|
---|
| 60 | // Register
|
---|
[925] | 61 | Root::getSingleton().addSceneManagerFactory(occlusionCullingPlugin);
|
---|
[1163] | 62 | Root::getSingleton().addSceneManagerFactory(kdTreeFactory);
|
---|
[1273] | 63 | Root::getSingleton().addSceneManagerFactory(kdTerrainFactory);
|
---|
[59] | 64 | }
|
---|
[115] | 65 | //-----------------------------------------------------------------------
|
---|
[133] | 66 | extern "C" void __declspec(dllexport) dllShutdownPlugin()
|
---|
[59] | 67 | {
|
---|
[925] | 68 | Root::getSingleton().removeSceneManagerFactory(occlusionCullingPlugin);
|
---|
[1163] | 69 | Root::getSingleton().removeSceneManagerFactory(kdTreeFactory);
|
---|
[1273] | 70 | Root::getSingleton().removeSceneManagerFactory(kdTerrainFactory);
|
---|
[897] | 71 | // destroy listener manager
|
---|
| 72 | delete TerrainPageSourceListenerManager::getSingletonPtr();
|
---|
[1273] | 73 | delete KdTerrainPageSourceListenerManager::getSingletonPtr();
|
---|
[133] | 74 | }
|
---|
| 75 | //-----------------------------------------------------------------------
|
---|
| 76 | extern "C" void __declspec(dllexport) dllStopPlugin()
|
---|
| 77 | {
|
---|
[657] | 78 | //delete heightmapTerrainPageSource;
|
---|
[1151] | 79 | // BUG: crashes on delete!!!! FIX this
|
---|
[925] | 80 | delete occlusionCullingPlugin;
|
---|
[1163] | 81 | delete kdTreeFactory;
|
---|
[1273] | 82 | delete kdTerrainFactory;
|
---|
[925] | 83 |
|
---|
[59] | 84 | delete visManager;
|
---|
[120] | 85 | delete visEnv;
|
---|
[59] | 86 | }
|
---|
| 87 |
|
---|
[133] | 88 |
|
---|
[925] | 89 |
|
---|
[59] | 90 | } //namespace Ogre
|
---|