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