virtual bool PrepareForReset() override;
PrepareForReset and RestoreAfterReset deal with the situation in which the rendering context is lost.