import glesv2
intrude import geometry::points_and_lines # For _x, _y and _z
+intrude import matrix
import matrix::projection
import more_collections
import performance_analysis
import gamnit
-import gamnit::cameras
+import gamnit::cameras_cache
import gamnit::dynamic_resolution
import gamnit::limit_fps
-
-import android_two_fingers_motion is conditional(android)
+import gamnit::camera_control
# Draw a `texture` at `center`
#
{
if(use_texture) {
gl_FragColor = v_color * texture2D(texture0, v_coord);
- if (gl_FragColor.a <= 0.1) discard;
+ if (gl_FragColor.a <= 0.01) discard;
} else {
gl_FragColor = v_color;
}
redef fun clear
do
+ for sprite in self do
+ sprite.context = null
+ sprite.sprite_set = null
+ end
super
for c in contexts_items do c.destroy
contexts_map.clear
else
rot = new Matrix.rotation(sprite.rotation, 0.0, 0.0, 1.0)
end
- data.fill_from(rot.items, o+15)
+ data.fill_from_matrix(rot, o+15)
o += float_per_vertex
end
return ss.join
end
end
+
+redef class GLfloatArray
+ private fun fill_from_matrix(matrix: Matrix, dst_offset: nullable Int)
+ do
+ dst_offset = dst_offset or else 0
+ var mat_len = matrix.width*matrix.height
+ assert length >= mat_len + dst_offset
+ native_array.fill_from_matrix_native(matrix.items, dst_offset, mat_len)
+ end
+end
+
+redef class NativeGLfloatArray
+ private fun fill_from_matrix_native(matrix: matrix::NativeDoubleArray, dst_offset, len: Int) `{
+ int i;
+ for (i = 0; i < len; i ++)
+ self[i+dst_offset] = (GLfloat)matrix[i];
+ `}
+end