Changeset 1306 for GTP/trunk/App/Demos/Geom/Demo_LodTrees
- Timestamp:
- 08/31/06 17:11:13 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Geom/Demo_LodTrees
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Geom/Demo_LodTrees/main.cpp
r1124 r1306 67 67 } 68 68 69 ibuf = Ogre::HardwareBufferManager::getSingleton().createIndexBuffer( 70 Ogre::HardwareIndexBuffer::IT_32BIT, // type of index 71 indices_to_render, // number of indexes 72 Ogre::HardwareBuffer::HBU_DISCARDABLE , // usage 73 false); // no shadow buffer 74 75 mRenderOp.indexData->indexBuffer = ibuf; 69 ibuf = mRenderOp.indexData->indexBuffer; 76 70 mRenderOp.indexData->indexStart = 0; 77 71 mRenderOp.indexData->indexCount = indices_to_render; … … 276 270 Geometry::Mesh *themesh = meshloader->load("../../../OgreStuff/media/GT/ML12m.mesh"); 277 271 272 if (!meshloader->GetLodStripsData()) 273 OGRE_EXCEPT(1, "The loaded mesh does not contain LOD info for the trunk","LOD Demo"); 274 if (!meshloader->GetTreeSimpSeq()) 275 OGRE_EXCEPT(1, "The loaded mesh does not contain LOD info for the foliage","LOD Demo"); 276 278 277 myTrees = new Geometry::LodTreeLibrary(meshloader->GetLodStripsData(),meshloader->GetTreeSimpSeq(),themesh); 279 278 … … 283 282 { 284 283 bool istrunk = myTrees->GetLeavesSubMesh()!=submesh; 284 int indices_to_render = 0; 285 285 if (istrunk) 286 { 286 287 entity->getSubEntity(submesh)->setMaterialName("Examples/Populifolia/trunk"); 288 indices_to_render = myTrees->GetValidTrunkIndexCount(submesh); 289 } 287 290 else 291 { 288 292 entity->getSubEntity(submesh)->setMaterialName("Examples/Populifolia/leaf"); 293 indices_to_render = myTrees->CurrentLOD_Foliage_IndexCount(); 294 } 295 296 Ogre::RenderOperation mRenderOp; 297 ogreMesh->getSubMesh(submesh)->_getRenderOperation(mRenderOp,0); 298 299 mRenderOp.indexData->indexBuffer = Ogre::HardwareBufferManager::getSingleton().createIndexBuffer( 300 Ogre::HardwareIndexBuffer::IT_32BIT, // type of index 301 indices_to_render, // number of indexes 302 Ogre::HardwareBuffer::HBU_DISCARDABLE , // usage 303 false); // no shadow buffer 289 304 } 290 305
Note: See TracChangeset
for help on using the changeset viewer.