Is it bad practice to have nested render loops?
<p>I'm porting a game from Ruby to C++. There is a main render loop that updates and draw the content. Now let's say that during the game, you want to select an item another screen. The way it's done in the original code is to do <code>Item item = getItemFromMenu();</code> <code>getItemFromMenu</code> is a function that will open the menu and do have its own update/render loop, which mean that during the whole time the player has this other screen open, you are in a nested render loop. I feel like this is a bad method but I'm not sure why. On the other hand it's very handy because I can open the menu with just 1 function call and so the code is localized.
Any idea if this is a bad design or not?
I hesitated to post it on gamedev, but since this is mostly a design issue I posted it here</p>

<p>edit : some pseudo-code to give you an idea:</p>

<p>The usual loop in the main part of the code:</p>

<pre><code>while(open) {
   UpdateGame();
   DrawGame();
}
</code></pre>

<p>now inside UpdateGame() i would do something like:</p>

<pre><code>if(keyPressed == "I") {
   Item&amp; item = getItemFromInventory();
}
</code></pre>

<p>And <code>getItemFromInventory()</code>:</p>

<pre><code> while(true) {
    UpdateInventory();

    if(item_selected) return item;
    DrawInventory();
 }
</code></pre>
