Thanks for the quick reply!
Is it intentional that you're drawing the board only one time or when the window is resized?
For now, yes. In other words, my goal is just to have a "game" with this one rule: the "player" resizes the window and the chess board maintains its [square] aspect ratio under these two conditions:
1. The chess board is always centered horizontally and vertically within the window
2. By necessity [to meet the above conditions] the side length of the square board always equals the shorter length between the window width and window height.
Here are three screenshots showing the situation.
Screenshot 1: The first screenshot is the app when it first opens (everything is as expected).
Screenshot 2: The second screenshot is the app resized where the width is greater than the height (this always works as expected and the chess board "scales" and is positioned as mentioned above).
Screenshot 3: The third screenshot shows the issue I'm having (when the window is resized so that the width is less than the height, the board disappears.
Seems to me the clear/draw/display should be outside of the event loop.
Also, any reason to create a new board, instead of resizing the existing one?
I'm happy to do any of these things (I already tried them and am prepared to make a post explaining the results I observed)... but first I just wanted to ask: given the above explanation and the pictures, is there a clear cause for the board's disappearance? I've tried treating the positioning symmetrically with respect to x shifts and y shifts but that doesn't seem to be good enough somehow:
https://github.com/tarstevs/chess/blob/master/src/board.cpp#:~:text=*/-,if%20(windowSize.x%20%2D%20windowSize.y%20%3C%200)%20%7B,%7D,-set_open_sans_font()%3B