//--------------------------------------------------------------------- void PanelOverlayElement::initialise(void) { bool init = !mInitialised; OverlayContainer::initialise(); if (init) { // Setup render op in advance mRenderOp.vertexData = OGRE_NEW VertexData(); // Vertex declaration: 1 position, add texcoords later depending on #layers // Create as separate buffers so we can lock & discard separately VertexDeclaration* decl = mRenderOp.vertexData->vertexDeclaration; decl->addElement(POSITION_BINDING, 0, VET_FLOAT3, VES_POSITION); // Basic vertex data mRenderOp.vertexData->vertexStart = 0; mRenderOp.vertexData->vertexCount = 4; // No indexes & issue as a strip mRenderOp.useIndexes = false; mRenderOp.operationType = RenderOperation::OT_TRIANGLE_STRIP; mRenderOp.useGlobalInstancingVertexBufferIsAvailable = false; mInitialised = true; _restoreManualHardwareResources(); } }
//--------------------------------------------------------------------- void TextAreaOverlayElement::checkMemoryAllocation( size_t numChars ) { if( mAllocSize < numChars) { mAllocSize = numChars; // Create and bind new buffers // Note that old buffers will be deleted automatically through reference counting _restoreManualHardwareResources(); } }