No real 'fullscreen' option on kha native targets?

491 views Asked by At

Question: Is there any way to set a native (cpp) target to a 'real' fullscreen without faking it using the screen width and height? Last answers about that subject are kind of old now.

Also: If the answer is no, is there any specific reason why? (except not being yet implemented)

The more I use kha, the more it feel like it slightly oriented to JS target (I kinda understand since many kha features are possible thanks to Javascript). It explains the missing fullscreen feature since the JS target would fill the container/canvas but most kha users I know are targeting native.

2

There are 2 answers

0
dmitryhryppa On

You can use real fullscreen (change resolution in your OS) mode on cpp (native, desktop) target through the System.initEx. Check the implementation: https://github.com/Kode/Kha/blob/master/Sources/kha/System.hx#L29

Example:

    var fullscreen:Bool = true;
    var windowOptions:WindowOptions = {
        width : width,
        height : height,
        mode : fullscreen ? Mode.Fullscreen : Mode.Window,
        title : title,
        windowedModeOptions : {
            resizable:false
        }
    };

    System.initEx(title, [windowOptions], windowCallback, initializedCallback);
0
RobDangerous On

Just made that easier (and more reliable), you can now do something ala System.init({title: "Blocks", width: 1024, height: 768, windowMode: kha.WindowMode.Fullscreen}, init);

I think it's only implemented for Windows so far, created an issue so you can watch further progress: https://github.com/Kode/Kha/issues/542