Skip to content

Commit

Permalink
temp fix #5 List runtimeType is different on Android debug release mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabia committed Dec 7, 2021
1 parent 69e6c0a commit 6b10d05
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions flutter_gl/lib/openGL/opengl/OpenGLContextES.dart
Original file line number Diff line number Diff line change
Expand Up @@ -774,13 +774,10 @@ class OpenGLContextES extends OpenGL30Constant {
}

uniform3fvNormal(location, List<num> value) {
// print("OpenGLContextES 1 uniform3fvNormal ${DateTime.now().millisecondsSinceEpoch} ");
print("OpenGLContextES uniform3fvNormal ${value} ");
var arrayPointer = toPointer(value);
gl.glUniform3fv(location, value.length ~/ 3, arrayPointer);
calloc.free(arrayPointer);

// print("OpenGLContextES 2 uniform3fvNormal ${DateTime.now().millisecondsSinceEpoch} ");
return;
}

uniform3fvNative(location, NativeArray value) {
Expand Down Expand Up @@ -916,9 +913,9 @@ class ActiveInfo {


toPointer(data) {
if(data is Float32List || data.runtimeType.toString() == "List<double>") {
if(data is Float32List || data.runtimeType.toString() == "List<double>" || data.runtimeType.toString() == "_GrowableList<double>") {
final ptr = calloc<Float>(data.length);
ptr.asTypedList(data.length).setAll(0, data.toList() as List<double>);
ptr.asTypedList(data.length).setAll(0, data.toList());
return ptr;

} else if(data is Uint8List) {
Expand Down

0 comments on commit 6b10d05

Please sign in to comment.