Move image object to global variable so it does not get re-declared on every actionLoad()

This commit is contained in:
Matt McWilliams 2024-10-22 15:03:30 -04:00
parent 4a9ddae1c4
commit 27921f0155
1 changed files with 2 additions and 1 deletions

View File

@ -37,6 +37,7 @@ GLint screenHeight = 0;
Image img; Image img;
State state; State state;
Mat image;
uint64_t exposureTime = 0; uint64_t exposureTime = 0;
uint64_t exposureElapsedTime = 0; uint64_t exposureElapsedTime = 0;
@ -101,7 +102,7 @@ uint64_t actionLoad () {
auto localStartTime = steady_clock::now(); auto localStartTime = steady_clock::now();
string imagePath = state.getImage(); string imagePath = state.getImage();
vector<uint64_t> position = state.getPosition(); vector<uint64_t> position = state.getPosition();
Mat image = img.loadImage(imagePath, position[0], position[1], position[2], position[3]); image = img.loadImage(imagePath, position[0], position[1], position[2], position[3]);
glGenTextures(1, &imageTexture); glGenTextures(1, &imageTexture);
glBindTexture(GL_TEXTURE_2D, imageTexture); glBindTexture(GL_TEXTURE_2D, imageTexture);