Why does openfl-samples happen failures of OpenFL 4.1.0?

Hello everyone,

why do openfl not check if openfl-samples have error and issues :frowning:

SimpleOpenGLView has 6 conflicts :frowning:

Source/Main.hx:213: characters 73-97 : openfl.Vector should be Null
Source/Main.hx:213: characters 73-97 : openfl.Vector should be Int
Source/Main.hx:213: characters 73-97 : For optional function argument 'elements’
Source/Main.hx:214: characters 72-95 : openfl.Vector should be Null
Source/Main.hx:214: characters 72-95 : openfl.Vector should be Int
Source/Main.hx:214: characters 72-95 : For optional function argument ‘elements’

PS: How do I fix? Because I want build for Tilemap under OpenGLView

  GL.uniformMatrix4fv (projectionMatrixUniform, false, new Float32Array (projectionMatrix.rawData));
  GL.uniformMatrix4fv (modelViewMatrixUniform, false, new Float32Array (modelViewMatrix.rawData));

Please tell me! How do I fix errors?

I have fixed it because good solution from members have written code from githurb but newest version of SimpleOpenGLView was wrong because rawData is not Int. rawData is Byte.

I see what the problem is. In the latest version of OpenFL, Vector is no longer the same as Array. Apparently it’s only the first step towards a better implementation, but it’s going to break a lot of things in the meantime.

Here are the two the simplest workarounds I can think of:

GL.uniformMatrix4fv (projectionMatrixUniform, false, new Float32Array ((untyped projectionMatrix.rawData.__array:Array<Float>)));
GL.uniformMatrix4fv (modelViewMatrixUniform, false, new Float32Array (null, null, untyped modelViewMatrix.rawData.__array));

All Vector implementations have an “__array” field that’s an array of the correct type. However, there’s no valid way to get at that field (not even @:privateAccess), so you have to resort to Reflect or untyped. But since that returns Dynamic, you either have to tell Haxe what the resulting type will be, or you need to tell it that this is the third parameter.

Good idea @player_03

But build it completed. Good!

But I run SimpleOpenGLView and it shows only white window, hahaha! No showing of openfl logo.- How do I fix?

I found old version of Openfl 4.0.3 works fine 4.0.2 works fine and 4.0.1 works fine and openfl 4.0.0 works fine …

Cheers Jens

Hello @player_03 I found SimpleOpenGLView from NME 5.6.30/samples

It works fine because Float32Array from NME library is fresh and fixed. That is why Not Vector from openfl just check and fix Float32Array from openfl is an issue.

I have tested NME’s Float32Array and it shows like it works fine for latest Visual Studio 2015 community. Yay I am happy because NME still is alive and works more than Lime!!! Because Lime has bad contents with wrong lines or bugged codes… I want show you my proof…

I have tested it. It works fine 100 % more than lime/openfl So sad news because Float32Array from openfl is sometimes bugged and messed up… Please check improved Float32Array from NME because NME’s Float32Array is like clean file…

1 Like

Thanks for reporting :slight_smile:

I have updated Lime to allow conversion of openfl.Vector to Lime typed arrays

I also improved the “SimpleOpenGLView” sample, cleaning up some code and handling the premultiplied alpha and color order of the BitmapData object better.

If you want to write direct OpenGL calls

…then I think the Lime “SimpleImage” sample and API may be better


Thanks for answer sorry late answer because I get other messages… thanks!

Your solution is so close to SimpleOpenGLView. So sad forf Openfl SimpleOpenGLView. When does Openfl get fixed release?

This should be fixed using source versions, we will release a new version of Lime and OpenFL fairly soon, when we are sure things are stable again

1 Like