I have heard that you can use NSScreen frame to get the current resolution of the screen, is there an alternative version that doesn't need objective c code?
Or even just rename your .cpp file to .mm (Objective-C++) and put the [[NSScreen mainScreen] frame] right in there. Apple allow Objective-C, C and C++ to be freely intermingled.
Note that you'll get the frame of the main screen. You can use [[window screen] frame] to get the frame for the screen that a particular NSWindow is on.