Move glDeleteTextures staements

This commit is contained in:
Matt McWilliams 2024-10-22 20:03:26 -04:00
parent d6d3632315
commit d5b2b63681
1 changed files with 2 additions and 2 deletions

View File

@ -80,6 +80,7 @@ uint64_t actionStop () {
completed = true;
auto currentTime = steady_clock::now();
auto elapsedTime = duration_cast<milliseconds>(currentTime - startTime).count();
glDeleteTextures(1, &imageTexture);
cout << "{ \"exposed\" : " << elapsedTime << ", \"exposure\" : null }" << endl;
return elapsedTime;
}
@ -165,7 +166,6 @@ void display () {
actionDisplay();
} else if (state.getAction() == STOP) {
data = actionStop();
glDeleteTextures(1, &imageTexture);
}
state.setInactive();
}
@ -182,12 +182,12 @@ void display () {
auto currentTime = steady_clock::now();
auto elapsedTime = duration_cast<milliseconds>(currentTime - startTime).count();
if (elapsedTime >= exposureTime) {
glDeleteTextures(1, &imageTexture);
exposureElapsedTime = elapsedTime;
cout << "{ \"exposed\" : " << elapsedTime << ", \"exposure\" : " << exposureTime << " }" << endl;
displaying = false;
//timing = false;
completed = true;
glDeleteTextures(1, &imageTexture);
}
}