away3d / away3d-core-openfl

Away3D engine for OpenFL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Type problem in away3d/core/managers/Stage3DProxy.hx

Type1J opened this issue · comments

This one may be related to Haxe 3.2, but I haven't tested earlier compiler versions. I think that it's more likely a type change in OpenFL 3.0.0-beta.

In away3d/core/managers/Stage3DProxy.hx ~line 539:

    // ugly stuff for backward compatibility
    var renderMode:Context3DRenderMode = (forceSoftware) ? Context3DRenderMode.SOFTWARE : Context3DRenderMode.AUTO;
    _stage3D.requestContext3D(Std.string(renderMode));

I get:

away3d/core/managers/Stage3DProxy.hx:541: characters 34-56 : String should be Null<flash.display3D.Context3DRenderMode>

I'm not sure what the intent was here, but changing the last line to:

    _stage3D.requestContext3D(renderMode);

seems to make everything work correctly for flash, but not for other platforms.

It seems that this works:

#if flash
    _stage3D.requestContext3D(renderMode);
#else
    _stage3D.requestContext3D(Std.string(renderMode));
#end