Detect current desktop resolution

Monkey Targets Forums/Desktop/Detect current desktop resolution

lom(Posted 2014) [#1]
Is it possible?


lom(Posted 2014) [#2]
Found it: http://www.monkey-x.com/Community/posts.php?topic=5727


ImmutableOctet(SKNG)(Posted 2014) [#3]
What you posted is correct for the standard GLFW and XNA targets, but the experimental GLFW3 target does not support the original functionality for display management (At the moment). Using Mojo's implementation might be your best bet for a fall-back. GLFW3 is still rather new, so supporting it really is up to you. Later down the road, I imagine it'll just become the normal target, and the current GLFW target (GLFW2) will be there as a legacy target (If at all). When using GLFW3 external code, or just checking for it in general, check if the preprocessor variable 'GLFW_VERSION' is defined and/or set to 3.

Checks can be done like this:
' Something like this should work, even if Mark decides to define 'GLFW_VERSION' on the GLFW2 target.
#If GLFW_VERSION And GLFW_VERSION = 3
	...
#End


Weirdly, the online documentation isn't up to date, so you'll need to look locally for the 'SetDeviceWindow' command (Target agnostic Mojo version; located in 'mojo.app'). You can actually just type that in and press F1 (If you're using an IDE which supports the standard documentation; could be different with third party IDEs).