void GuiElement::GenerateMesh() { if(m_NeedsUpdate) { Mesh* mesh = new Mesh(); Vec2 Pos = Vec2(0,0); mesh->AddVertex(Vec3(Pos.x,Pos.y, 0)); mesh->AddTexCoord(Vec2(0,0)); mesh->AddVertex(Vec3(Pos.x,Pos.y + m_Size.y,0)); mesh->AddTexCoord(Vec2(0,1)); mesh->AddVertex(Vec3(Pos.x + m_Size.x,Pos.y,0)); mesh->AddTexCoord(Vec2(1,0)); mesh->AddVertex(Vec3(Pos.x + m_Size.x,Pos.y,0)); mesh->AddTexCoord(Vec2(1,0)); mesh->AddVertex(Vec3(Pos.x,Pos.y + m_Size.y,0)); mesh->AddTexCoord(Vec2(0,1)); mesh->AddVertex(Vec3(Pos + m_Size,0)); mesh->AddTexCoord(Vec2(1,1)); //if(m_Font) //m_Font->AddToMesh(mesh, InnerText_,Vec3(0,0,0),(i32)m_Size.x, FontSize_); m_Component->SetMesh(mesh); m_NeedsUpdate = false; } }