When keyAfterExperiment is true, we write a message to the screen
and then wait for a key press. However, when using the software overlay,
writing that message occurs after the CLUT textures for the overlay
have been destroyed, so the text colour is unpredictable.
This change splits the writing of the message and the waiting for
the key press into two steps. The text is drawn before the CLUT
textures are destroyed, and then we wait for a keypress after the
data has been saved.
When keyAfterExperiment is true, we write a message to the screen and then wait for a key press. However, when using the software overlay, writing that message occurs after the CLUT textures for the overlay have been destroyed, so the text colour is unpredictable.
This change splits the writing of the message and the waiting for the key press into two steps. The text is drawn before the CLUT textures are destroyed, and then we wait for a keypress after the data has been saved.