From cc045fe775d9b3afd5efc9f41b83116991c80f00 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Sat, 27 Apr 2024 11:55:33 -0600 Subject: [PATCH] Optionally set the port with an argument. --- src/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d01bf15..d40e531 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -22,7 +22,7 @@ using namespace std; -const uint16_t PORT = 8081; +uint16_t PORT = 8081; const uint16_t BUFFER_SIZE = 2048; GLuint imageTexture = 0; @@ -68,7 +68,6 @@ void actionStop () { void loadBlank () { Mat blank = img.getBlank(); - glGenTextures(1, &blankTexture); glBindTexture(GL_TEXTURE_2D, blankTexture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); @@ -237,7 +236,10 @@ uint8_t handleArgs (int argc, char** argv) { cerr << "Please provide screen height as second argument" << endl; return 2; } - cout << screenWidth << "x" << screenHeight << endl; + if (argc > 3) { + PORT = (uint16_t) atoi(argv[3]); + cout << "Set port: " << PORT << endl; + } return 0; } @@ -252,7 +254,7 @@ int main (int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE); - glutCreateWindow("opengl_opencv_example"); + glutCreateWindow("filmout_display"); glutSetCursor(GLUT_CURSOR_NONE); glutFullScreen(); glutDisplayFunc(display);