I've been fiddling with PocketFrog over spring break, writing a little moon lander game. Overall I love the library - it's powerful and easy to use.
In my game I have a main menu screen and a game play scene and I think my state management between the two is buggy. Sometimes when the game is initializing the new level (which is randomly generated), it will crash when trying to get the display pointer. This, I don't really understand. Is there anytime after GameInit has been called that GetDisplay won't return a valid pointer? Has anyone run into similar problems? I'm hoping that a refactoring of the state management code will fix everything, but this has been one hell of a bug to track down - so any suggestions would be greatly appreciated. Thanks!!!
For reference
In my code, I'm trying to execute:
DisplayDevice* display = GetDisplay();
display->SetRenderTarget(m_landscape);
display->Clear( Color(0,0,0) );
Which sometimes will cause an exception here (and deeper in the display driver internals):
DisplayDevice* Game::GetDisplay()
{
DisplayDevice* display = m_display.get();
if (display)
display->BeginScene();
return display;
}