Documentation for glfw & xna resolution

Monkey Forums/Monkey Programming/Documentation for glfw & xna resolution

Tibit(Posted 2013) [#1]
I can't find the docs on the new glfw resolution feature. I'm looking in mojo.graphics. Any ideas where I should look or is it not added yet?

I decided to quickly create some docs for future references and ask about the things that is not obvious (see end of post).

All code needs to be found inside a :
#If TARGET="glfw"
'Your glfw resolution code here
#Endif

if TARGET="xna"
'Your xna resolution code here
#Endif

GetGlfwDesktopMode:GlfwVideoMode()
Return resolution that the current desktop's primary screen is using.

How to use:
[monkeycode]
Local mode:GlfwVideoMode = GetGlfwDesktopMode:GlfwVideoMode()
Print mode.Width+","+mode.Height+","+mode.RedBits+","+mode.GreenBits+","+mode.BlueBits
[/monkeycode]

GetGlfwVideoModes:GlfwVideoMode[]()

Return possible resolutions supported for glfw target

How to use:
[monkeycode]
#If TARGET="glfw"
For Local mode:GlfwVideoMode = Eachin GlfwGame.GetGlfwGame().GetGlfwVideoModes()
Print mode.Width+","+mode.Height+","+mode.RedBits+","+mode.GreenBits+","+mode.BlueBits
Next
#Endif
[/monkeycode]

GetXnaDisplayModes:XnaDisplayMode()

How to use:
[monkeycode]
If TARGET="xna"
For Local mode:=Eachin XnaGame.GetXnaGame().GetXnaDisplayModes()
Print mode.Width+","+mode.Height+","+mode.Format
Next
#Endif
[/monkeycode]


SetGlfwWindow:Void( width:Int, height:Int, red:Int, green:Int, blue:Int, alpha:Int, depth:Int, stencil:Int, fullscreen:Bool )

SetXnaDisplayMode( width:Int, height:Int,??,fullscreen:bool )
Set a resolution for the window using width, height.

How to use:
GlfwGame.GetGlfwGame().SetGlfwWindow 1024,768,8,8,8,0,0,0,True 'Fullscreen 1024x768

GlfwGame.GetGlfwGame().SetGlfwWindow 1024,768,8,8,8,0,0,0,False 'Window 1024x768

XnaGame.GetXnaGame().SetXnaDisplayMode( 1024,768,1,True )


Notes:
Set app config settings GLFW_WINDOW_WIDTH and GLFW_WINDOW_HEIGHT to 0 to disable initial graphics window - but make sure to create one using SetGlfwWindow above before OnCreate finishes!

Use ShowMouse and HideMouse to enable disable operating system mouse pointer.




Questions:

* What does mode format in xna mean?

* Why can I set GLFW_WINDOW_WIDTH + HEIGHT? When should I use this instead of GlfwGame.GetGlfwGame().SetGlfwWindow?

* What is retreival of mode.RedBits mode.GreenBits mode.BlueBits used for?

* Why can I set red:Int, green:Int, blue:Int - when is that used?

* What are the usage for alpha:Int, depth:Int, stencil:Int? Which values are to be expected?

* Can we use the "fullscreen windowed borderless mode" - allowing the app to be fullscreen without a windowborder so the OS can still be used normally in the background (as if the app was a normal window).

* Can we get additional screens? Can we spawn additional windows and use more than one screen? For example could I have a OverviewMap on the right screen and the game on the left screen in fullscreen mode?


wiebow(Posted 2013) [#2]
Do you know where the glfwgame and xnagame classes are defined? I can't find them either :/

[edit] never mind, I found them in targets/glfw/modules/monkeytarget.monkey.


Nobuyuki(Posted 2013) [#3]
guessing this is undoc'd because mark still plans on wrapping the methods into a more platform-agnostic package (meaning that method signatures will change)