Changeset 2791 for code/trunk
- Timestamp:
- Mar 16, 2009, 1:21:57 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/ogreceguirenderer/OgreCEGUIRenderer.cpp
r2790 r2791 3 3 created: 11/5/2004 4 4 author: Paul D Turner 5 5 6 6 purpose: Implementation of Renderer class for Ogre engine 7 7 *************************************************************************/ … … 54 54 Utility function to create a render operation and vertex buffer to render quads 55 55 *************************************************************************/ 56 static void createQuadRenderOp(Ogre::RenderOperation &d_render_op, 56 static void createQuadRenderOp(Ogre::RenderOperation &d_render_op, 57 57 Ogre::HardwareVertexBufferSharedPtr &d_buffer, size_t nquads) 58 58 { … … 72 72 73 73 // create hardware vertex buffer 74 d_buffer = HardwareBufferManager::getSingleton().createVertexBuffer(vd->getVertexSize(0), nquads, 74 d_buffer = HardwareBufferManager::getSingleton().createVertexBuffer(vd->getVertexSize(0), nquads, 75 75 HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY_DISCARDABLE, false); 76 76 … … 83 83 } 84 84 85 static void destroyQuadRenderOp(Ogre::RenderOperation &d_render_op, 85 static void destroyQuadRenderOp(Ogre::RenderOperation &d_render_op, 86 86 Ogre::HardwareVertexBufferSharedPtr &d_buffer) 87 87 { … … 146 146 d_sorted = false; 147 147 QuadInfo quad; 148 148 149 149 // set quad position, flipping y co-ordinates, and applying appropriate texel origin offset 150 150 quad.position.d_left = dest_rect.d_left; … … 170 170 quad.bottomLeftCol = colourToOgre(colours.d_top_left); 171 171 quad.bottomRightCol = colourToOgre(colours.d_top_right); 172 172 173 173 // set quad split mode 174 174 quad.splitMode = quad_split_mode; … … 229 229 buffmem->tv1 = quad.texPosition.d_bottom; 230 230 ++buffmem; 231 231 232 232 // setup Vertex 2... 233 233 234 234 // top-left to bottom-right diagonal 235 235 if (quad.splitMode == TopLeftToBottomRight) … … 253 253 } 254 254 ++buffmem; 255 255 256 256 // setup Vertex 3... 257 257 buffmem->x = quad.position.d_left; … … 262 262 buffmem->tv1 = quad.texPosition.d_top; 263 263 ++buffmem; 264 264 265 265 // setup Vertex 4... 266 266 buffmem->x = quad.position.d_right; … … 271 271 buffmem->tv1 = quad.texPosition.d_bottom; 272 272 ++buffmem; 273 273 274 274 // setup Vertex 5... 275 275 buffmem->x = quad.position.d_right; … … 280 280 buffmem->tv1 = quad.texPosition.d_top; 281 281 ++buffmem; 282 282 283 283 // setup Vertex 6... 284 284 285 285 // top-left to bottom-right diagonal 286 286 if (quad.splitMode == TopLeftToBottomRight) … … 305 305 ++buffmem; 306 306 } 307 307 308 308 // ensure we leave the buffer in the unlocked state 309 309 d_buffer->unlock(); 310 310 } 311 311 312 312 /// Render the buffer 313 313 d_bufferPos = 0; … … 318 318 while(i != d_quadlist.end()) 319 319 { 320 320 321 321 d_currTexture = i->texture; 322 322 d_render_op.vertexData->vertexStart = d_bufferPos; … … 426 426 427 427 /************************************************************************* 428 setup states etc 428 setup states etc 429 429 *************************************************************************/ 430 430 void OgreCEGUIRenderer::initRenderStates(void) … … 469 469 470 470 471 472 /************************************************************************* 473 sort quads list according to texture 471 472 /************************************************************************* 473 sort quads list according to texture 474 474 *************************************************************************/ 475 475 void OgreCEGUIRenderer::sortQuads(void) … … 525 525 526 526 // setup Vertex 2... 527 527 528 528 // top-left to bottom-right diagonal 529 529 if (quad_split_mode == TopLeftToBottomRight) … … 577 577 578 578 // setup Vertex 6... 579 579 580 580 // top-left to bottom-right diagonal 581 581 if (quad_split_mode == TopLeftToBottomRight) … … 614 614 /************************************************************************* 615 615 convert ARGB colour value to whatever the Ogre render system is 616 expecting. 616 expecting. 617 617 *************************************************************************/ 618 618 uint32 OgreCEGUIRenderer::colourToOgre(const colour& col) const … … 628 628 629 629 /************************************************************************* 630 Set the scene manager to be used for rendering the GUI. 630 Set the scene manager to be used for rendering the GUI. 631 631 *************************************************************************/ 632 632 void OgreCEGUIRenderer::setTargetSceneManager(Ogre::SceneManager* scene_manager) … … 650 650 651 651 /************************************************************************* 652 Set the target render queue for GUI rendering. 652 Set the target render queue for GUI rendering. 653 653 *************************************************************************/ 654 654 void OgreCEGUIRenderer::setTargetRenderQueue(Ogre::uint8 queue_id, bool post_queue) … … 724 724 725 725 /************************************************************************* 726 Create a texture from an existing Ogre::TexturePtr object 726 Create a texture from an existing Ogre::TexturePtr object 727 727 *************************************************************************/ 728 728 Texture* OgreCEGUIRenderer::createTexture(Ogre::TexturePtr& texture) … … 749 749 750 750 /************************************************************************* 751 Set the size of the display in pixels. 751 Set the size of the display in pixels. 752 752 *************************************************************************/ 753 753 void OgreCEGUIRenderer::setDisplaySize(const Size& sz) … … 767 767 is rendered 768 768 *************************************************************************/ 769 void CEGUIRQListener::renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, 769 void CEGUIRQListener::renderQueueStarted(Ogre::uint8 id, const Ogre::String& invocation, 770 770 bool& skipThisQueue) 771 771 {
Note: See TracChangeset
for help on using the changeset viewer.