Move Mat blank to global variable, may have been creating 2 per frame

This commit is contained in:
Matt McWilliams 2024-10-22 16:27:44 -04:00
parent 1f1c9e2aff
commit b17840c8de
1 changed files with 2 additions and 1 deletions

View File

@ -38,6 +38,7 @@ GLint screenHeight = 0;
Image img; Image img;
State state; State state;
Mat image; Mat image;
Mat blank;
uint64_t exposureTime = 0; uint64_t exposureTime = 0;
uint64_t exposureElapsedTime = 0; uint64_t exposureElapsedTime = 0;
@ -129,7 +130,7 @@ uint64_t actionLoad () {
} }
void loadBlank () { void loadBlank () {
Mat blank = img.getBlank(); blank = img.getBlank();
glGenTextures(1, &blankTexture); glGenTextures(1, &blankTexture);
glBindTexture(GL_TEXTURE_2D, blankTexture); glBindTexture(GL_TEXTURE_2D, blankTexture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);