2

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.

HEYIMFUZZ
  • 85
  • 1
  • 6
  • 3
    If it's missing then it simply isn't implemented YET. It has nothing to do with being a JS oriented target though. That's some misconception. Kha is an abstraction layer for audio, input, graphics, etc for multitudes of platforms. I'm not sure on the answer itself because I don't know if the feature is currently missing or how to go about it. Hope other Kha users can answer. Edit: from the irc chat "Robert: Thanks! Guess I'll make fullscreen support working tomorrow. " Robert is the author of Kha. – Sidar Mar 21 '17 at 20:14

2 Answers2

4

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);
dmitryhryppa
  • 119
  • 3
  • 11
2

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

RobDangerous
  • 349
  • 2
  • 4