35 lines
1.1 KiB
Haxe
35 lines
1.1 KiB
Haxe
package game.video;
|
|
|
|
import game.ui.ConVar;
|
|
import openfl.Lib;
|
|
import openfl.display.StageDisplayState;
|
|
|
|
class Mode
|
|
{
|
|
public static function getWindow():lime.ui.Window
|
|
{
|
|
return Lib.application.window;
|
|
}
|
|
public static function setVideoMode(width:Int, height:Int, fs:Int = null){
|
|
getWindow().resize(width,height);
|
|
if(fs != null){
|
|
switchFsMode(fs);
|
|
}
|
|
}
|
|
public static var cvMatSetVideoMode:engine.typedefs.CCmd = ConVar.registerCCmd("mat_setvideomode",(args:Array<String>)->{
|
|
setVideoMode(Std.parseInt(args[0]), Std.parseInt(args[1]), Std.parseInt(args[2]));
|
|
});
|
|
public static function switchFsMode(toState:Int = 0){
|
|
if(toState == 0){
|
|
if(Lib.current.stage.displayState != StageDisplayState.FULL_SCREEN_INTERACTIVE){
|
|
Lib.current.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
|
|
}
|
|
else{
|
|
Lib.current.stage.displayState = StageDisplayState.NORMAL;
|
|
}
|
|
}
|
|
else{
|
|
|
|
}
|
|
}
|
|
} |