Open dimitre opened 2 years ago
reading the code I've noticed some hacks to make things work like this:
setWindowPosition(pos.x, pos.y); setWindowShape(screenSize.x, screenSize.y); setWindowPosition(pos.x, pos.y);
and inside function setWindowShape we have another setWindowPosition going. I'm proposing the creation of a function who does the two things at the same time, only to be used when position and shape (dimensions) are set at once.
//------------------------------------------------------------ void ofAppGLFWWindow::setWindowRectangle(ofRectangle rect) { if(settings.windowMode == OF_WINDOW){ windowW = rect.width; windowH = rect.height; } currentW = rect.width/pixelScreenCoordScale; currentH = rect.height/pixelScreenCoordScale; // cout << "glfwSetWindowSize " << ofGetFrameNum() << endl; glfwSetWindowSize(windowP,currentW,currentH); glfwSetWindowPos(windowP,rect.x/pixelScreenCoordScale,rect.y/pixelScreenCoordScale); }
+1. I would just use a const reference for the argument void ofAppGLFWWindow::setWindowRectangle(const ofRectangle& rect)
void ofAppGLFWWindow::setWindowRectangle(const ofRectangle& rect)
reading the code I've noticed some hacks to make things work like this:
and inside function setWindowShape we have another setWindowPosition going. I'm proposing the creation of a function who does the two things at the same time, only to be used when position and shape (dimensions) are set at once.