Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create variables for window parameters #1890

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 45 additions & 22 deletions templates/haxe/ApplicationMain.hx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,29 @@ import ::APP_MAIN::;

@:dox(hide) class ApplicationMain
{
private var _allowHighDPI = ::allowHighDPI::;
private var _alwaysOnTop = ::alwaysOnTop::;
private var _borderless = ::borderless::;
private var _frameRate = ::fps::;
private var _fullscreen = ::fullscreen::;
private var _height = ::height::;
private var _hidden = ::hidden::;
private var _maximized = ::maximized::;
private var _parameters = ::parameters::;
private var _resizable = ::resizable::;
private var _title = "::title::";
private var _width = ::width::;
private var _x = ::x::;
private var _y = ::y::;

private var _antialiasing = ::antialiasing::;
private var _background = ::background::;
private var _colorDepth = ::colorDepth::;
private var _depth = ::depthBuffer::;
private var _hardware = ::hardware::;
private var _stencil = ::stencilBuffer::;
private var _vsync = ::vsync::;

public static function main()
{
lime.system.System.__registerEntryPoint("::APP_FILE::", create);
Expand Down Expand Up @@ -35,35 +58,35 @@ import ::APP_MAIN::;
::foreach windows::
var attributes:lime.ui.WindowAttributes =
{
allowHighDPI: ::allowHighDPI::,
alwaysOnTop: ::alwaysOnTop::,
borderless: ::borderless::,
allowHighDPI: _allowHighDPI,
alwaysOnTop: _alwaysOnTop,
borderless: _borderless,
// display: ::display::,
element: null,
frameRate: ::fps::,
#if !web fullscreen: ::fullscreen::, #end
height: ::height::,
hidden: #if munit true #else ::hidden:: #end,
maximized: ::maximized::,
minimized: ::minimized::,
parameters: ::parameters::,
resizable: ::resizable::,
title: "::title::",
width: ::width::,
x: ::x::,
y: ::y::,
frameRate: _frameRate,
#if !web fullscreen: _fullscreen, #end
height: _height,
hidden: #if munit true #else _hidden #end,
maximized: _maximized,
minimized: _minimized,
parameters: _parameters,
resizable: _resizable,
title: _title,
width: _width,
x: _x,
y: _y,
};

attributes.context =
{
antialiasing: ::antialiasing::,
background: ::background::,
colorDepth: ::colorDepth::,
depth: ::depthBuffer::,
hardware: ::hardware::,
stencil: ::stencilBuffer::,
antialiasing: _antialiasing,
background: _background,
colorDepth: _colorDepth,
depth: _depth,
hardware: _hardware,
stencil: _stencil,
type: null,
vsync: ::vsync::
vsync: _vsync
};

if (app.window == null)
Expand Down