It would be easier to check "cancel" in render, but you also could do this:
bool show() {
if (cancel) return false;
//Showing stuff
return true;
}
void render() {
//Do something
if (!show()) return;
}
It would be easier to check "cancel" in render, but you also could do this:
bool show() {
if (cancel) return false;
//Showing stuff
return true;
}
void render() {
//Do something
if (!show()) return;
}