Minor fix

This commit is contained in:
Joshua Granick
2019-06-13 09:26:29 -07:00
parent 504458cd6a
commit 4eae752afe
2 changed files with 10 additions and 8 deletions

View File

@@ -55,6 +55,7 @@ class NativeWindow
public function new(parent:Window) public function new(parent:Window)
{ {
trace ("1");
this.parent = parent; this.parent = parent;
cursor = DEFAULT; cursor = DEFAULT;
@@ -64,7 +65,7 @@ class NativeWindow
var contextAttributes = Reflect.hasField(attributes, "context") ? attributes.context : {}; var contextAttributes = Reflect.hasField(attributes, "context") ? attributes.context : {};
var title = Reflect.hasField(attributes, "title") ? attributes.title : "Lime Application"; var title = Reflect.hasField(attributes, "title") ? attributes.title : "Lime Application";
var flags = 0; var flags = 0;
trace ("2");
if (!Reflect.hasField(contextAttributes, "antialiasing")) contextAttributes.antialiasing = 0; if (!Reflect.hasField(contextAttributes, "antialiasing")) contextAttributes.antialiasing = 0;
if (!Reflect.hasField(contextAttributes, "background")) contextAttributes.background = 0; if (!Reflect.hasField(contextAttributes, "background")) contextAttributes.background = 0;
if (!Reflect.hasField(contextAttributes, "colorDepth")) contextAttributes.colorDepth = 24; if (!Reflect.hasField(contextAttributes, "colorDepth")) contextAttributes.colorDepth = 24;
@@ -86,7 +87,7 @@ class NativeWindow
if (Reflect.hasField(attributes, "maximized") && attributes.maximized) flags |= cast WindowFlags.WINDOW_FLAG_MAXIMIZED; if (Reflect.hasField(attributes, "maximized") && attributes.maximized) flags |= cast WindowFlags.WINDOW_FLAG_MAXIMIZED;
if (Reflect.hasField(attributes, "minimized") && attributes.minimized) flags |= cast WindowFlags.WINDOW_FLAG_MINIMIZED; if (Reflect.hasField(attributes, "minimized") && attributes.minimized) flags |= cast WindowFlags.WINDOW_FLAG_MINIMIZED;
if (Reflect.hasField(attributes, "resizable") && attributes.resizable) flags |= cast WindowFlags.WINDOW_FLAG_RESIZABLE; if (Reflect.hasField(attributes, "resizable") && attributes.resizable) flags |= cast WindowFlags.WINDOW_FLAG_RESIZABLE;
trace ("3");
if (contextAttributes.antialiasing >= 4) if (contextAttributes.antialiasing >= 4)
{ {
flags |= cast WindowFlags.WINDOW_FLAG_HW_AA_HIRES; flags |= cast WindowFlags.WINDOW_FLAG_HW_AA_HIRES;
@@ -95,7 +96,7 @@ class NativeWindow
{ {
flags |= cast WindowFlags.WINDOW_FLAG_HW_AA; flags |= cast WindowFlags.WINDOW_FLAG_HW_AA;
} }
trace ("4");
if (contextAttributes.colorDepth == 32) flags |= cast WindowFlags.WINDOW_FLAG_COLOR_DEPTH_32_BIT; if (contextAttributes.colorDepth == 32) flags |= cast WindowFlags.WINDOW_FLAG_COLOR_DEPTH_32_BIT;
if (contextAttributes.depth) flags |= cast WindowFlags.WINDOW_FLAG_DEPTH_BUFFER; if (contextAttributes.depth) flags |= cast WindowFlags.WINDOW_FLAG_DEPTH_BUFFER;
if (contextAttributes.hardware) flags |= cast WindowFlags.WINDOW_FLAG_HARDWARE; if (contextAttributes.hardware) flags |= cast WindowFlags.WINDOW_FLAG_HARDWARE;
@@ -104,7 +105,7 @@ class NativeWindow
var width = Reflect.hasField(attributes, "width") ? attributes.width : #if desktop 800 #else 0 #end; var width = Reflect.hasField(attributes, "width") ? attributes.width : #if desktop 800 #else 0 #end;
var height = Reflect.hasField(attributes, "height") ? attributes.height : #if desktop 600 #else 0 #end; var height = Reflect.hasField(attributes, "height") ? attributes.height : #if desktop 600 #else 0 #end;
trace ("5");
#if (!macro && lime_cffi) #if (!macro && lime_cffi)
handle = NativeCFFI.lime_window_create(parent.application.__backend.handle, width, height, flags, title); handle = NativeCFFI.lime_window_create(parent.application.__backend.handle, width, height, flags, title);
@@ -119,7 +120,7 @@ class NativeWindow
} }
parent.__scale = NativeCFFI.lime_window_get_scale(handle); parent.__scale = NativeCFFI.lime_window_get_scale(handle);
trace ("6");
var context = new RenderContext(); var context = new RenderContext();
context.window = parent; context.window = parent;
@@ -128,7 +129,7 @@ class NativeWindow
#else #else
var contextType:String = NativeCFFI.lime_window_get_context_type(handle); var contextType:String = NativeCFFI.lime_window_get_context_type(handle);
#end #end
trace ("7");
switch (contextType) switch (contextType)
{ {
case "opengl": case "opengl":
@@ -169,7 +170,8 @@ class NativeWindow
#end #end
context.type = CAIRO; context.type = CAIRO;
} }
trace ("8");
trace(context.type);
contextAttributes.type = context.type; contextAttributes.type = context.type;
context.attributes = contextAttributes; context.attributes = contextAttributes;
parent.context = context; parent.context = context;

View File

@@ -29,7 +29,7 @@ abstract DataPointer(DataPointerType) to DataPointerType
var float:Float = value; var float:Float = value;
return new DataPointer(float); return new DataPointer(float);
#else #else
return 0; return cast value;
#end #end
} }
#else #else