blitz-foundation / monkey2

zlib License
3 stars 0 forks source link

Creating window based on DesktopSize causes black screen #73

Closed Pharmhaus-2 closed 5 years ago

Pharmhaus-2 commented 5 years ago

Original Author: Hezkore

If you use App.DesktopSize when creating a new window it'll stay a black window forever. Works in Mojo and Mojo3D.

I'm using Monkey 2 v2018.04

#Import "<std>"
#Import "<mojo>"
Using std..
Using mojo..

Class MyWindow Extends Window

    Method New()

        ' This causes a black screen
        Super.New( "test", App.DesktopSize.X*.7, App.DesktopSize.Y*.7, WindowFlags.Resizable )

        ' But this works
        'Super.New( "test", 1280, 720, WindowFlags.Resizable )
    End

    Method OnRender( canvas:Canvas ) Override

        App.RequestRender()
        canvas.DrawText( "Hello World!",Width/2,Height/2,.5,.5 )
    End

End

Function Main()
    New AppInstance
    New MyWindow
    App.Run()
End
Pharmhaus-2 commented 5 years ago

Fixed in develop.