Sorry the destroy method belongs to my derived class LODGame from
GLAnimCanvas.
As you can see (below) I seem to be doing everything Max suggests and I am
now beginning to wonder if it is a bug in my OGL driver and that Virgil
might be right.
As for the CardLayout idea, I know what he is getting at (not deleting the
panel, or creating a new GLAnimCanvas every time), however I tried it before
except just using Borderlayout and it didn't help.
I think the error messages which happen in every program when shutting down
or symptons of driver bugs and the cause.
public void destroy()
{
//Destroy the GLContext
cvsDispose();
}
And the start and end Game methods are:
public void startGame(DataInputStream input, DataOutputStream output)
{
removeAll();
game = new LODGame(getSize().width, getSize().height,
e_Name.getText() , b_Color.getBackground(), input,
output);
gamePanel.add(game);
add(gamePanel, BorderLayout.CENTER);
game.start();
validate();
}
public void stopGame()
{
game.destroy();
removeAll();
// Display UI code
...
}
|