HEYIMFUZZ
HEYIMFUZZ

Reputation: 85

No real 'fullscreen' option on kha native targets?

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.

Upvotes: 2

Views: 481

Answers (2)

RobDangerous
RobDangerous

Reputation: 369

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

Upvotes: 2

user2396965
user2396965

Reputation:

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);

Upvotes: 4

Related Questions