Force even resolution window
I am using GLFW/glfw3 OpenGL to write 2D games.
Some of my shaders have artifacts that only appear when the window size has an odd value. Eg 1201 by 1024 creates artifacts. 1200 by 1024 does not have artifacts.
The artifacts are unacceptable and must be fixed.
There are two solutions.
Rewrite all the shaders (which I would like to avoid as the source of the artifact is that I use a lot of integers rather than floats. There is a lot to rewrite / redesign)
And the easy quick fix... Ensure the screen size is always even.
Example code;
unsigned int windowWidth{wS->N->GetUInt("windowWidth")}; unsigned int windowHeight{wS->N->GetUInt("windowHeight")}; glfwCreateWindow( std::max(320, windowWidth / 2 * 2), // even std::max(200, windowHeight / 2 * 2), // even (const char*)&wS->N->GetString("appName")[0], NULL, NULL );
Question
Is there any reason to avoid forcing even resolutions / window size?
Fullscreen I believe is OK as I don't know of any display the has an odd dimension.
Will this cause problems in windowed mode on any OS or setup?