Optionally set the port with an argument.

This commit is contained in:
mmcwilliams 2024-04-27 11:55:33 -06:00
parent 78cca62c12
commit cc045fe775
1 changed files with 6 additions and 4 deletions

View File

@ -22,7 +22,7 @@
using namespace std; using namespace std;
const uint16_t PORT = 8081; uint16_t PORT = 8081;
const uint16_t BUFFER_SIZE = 2048; const uint16_t BUFFER_SIZE = 2048;
GLuint imageTexture = 0; GLuint imageTexture = 0;
@ -68,7 +68,6 @@ void actionStop () {
void loadBlank () { void loadBlank () {
Mat blank = img.getBlank(); Mat 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);
@ -237,7 +236,10 @@ uint8_t handleArgs (int argc, char** argv) {
cerr << "Please provide screen height as second argument" << endl; cerr << "Please provide screen height as second argument" << endl;
return 2; return 2;
} }
cout << screenWidth << "x" << screenHeight << endl; if (argc > 3) {
PORT = (uint16_t) atoi(argv[3]);
cout << "Set port: " << PORT << endl;
}
return 0; return 0;
} }
@ -252,7 +254,7 @@ int main (int argc, char** argv) {
glutInit(&argc, argv); glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE); glutInitDisplayMode(GLUT_SINGLE);
glutCreateWindow("opengl_opencv_example"); glutCreateWindow("filmout_display");
glutSetCursor(GLUT_CURSOR_NONE); glutSetCursor(GLUT_CURSOR_NONE);
glutFullScreen(); glutFullScreen();
glutDisplayFunc(display); glutDisplayFunc(display);