- Joined
- Jan 2, 2020
- Messages
- 1,414
Some desperate christmasnight-coding being done here.. and I might have run into a window-bug or not I'm not sure?
Maybe that last resolution-problem isn't totally solved just yet, please correct me if I'm wrong.
I feel that I need to understand why windows & screens behaves like they do before I start coding for real because I think it has changed since the two versions.
Got the last version of Cerberus installed and using macOS
Maybe that last resolution-problem isn't totally solved just yet, please correct me if I'm wrong.
I feel that I need to understand why windows & screens behaves like they do before I start coding for real because I think it has changed since the two versions.
Got the last version of Cerberus installed and using macOS
Cerberus:
Import mojo2
Function Main()
New MyApp
End
Class MyApp Extends App
Field canvas:Canvas
Method OnCreate()
canvas = New Canvas
SetSwapInterval 1
SetUpdateRate 0
Local width:Int = 1440 ' Change these to your
Local height:Int = 900 ' native resolution
' --------------------------------------------------------------
' SetViewport and SetProjection2d seems to be a must now to set window-size programatically.
' I just want to doublecheck that this is correct before I continue start coding for real.
' --------------------------------------------------------------
' I noticed something about windows sizes :
' This window will have a size of exactly width x height, but you won't get reszibility here of course
' SetDeviceWindow width,height, 4
' canvas.SetViewport 0,0,width,height
' canvas.SetProjection2d 0,width,0,height
' This is the troubling one, it won't give you a window of width x height but minus any menubar and dock! It will fill the free desktop space instead!
SetDeviceWindow width,height,2+4
canvas.SetViewport 0,0,width,height
canvas.SetProjection2d 0,width,0,height
' --------------------------------------------------------------
End
Method OnUpdate()
If KeyHit(KEY_ESCAPE) Then EndApp
End
Method OnRender()
canvas.Clear 0,0,1
canvas.Flush
End
End