From: Jean Privat Date: Wed, 29 Nov 2017 15:40:53 +0000 (-0500) Subject: Merge: gamnit: new services and a lot of bug fixes and performance improvements X-Git-Url: http://nitlanguage.org Merge: gamnit: new services and a lot of bug fixes and performance improvements This PR groups small fixes to gamnit and related packages. It is a general cleanup in preparation for optimizations to the gamnit depth 3D API. Intro a few new services: * `ParticleSystem::clear` to remove all live particles. * `CustomTexture` can be modified and reloaded in GPU memory after the first call to `load`. * Don't apply dynamic resolution to UI sprites as they are usually lightweight and any change in resolution is easily noticable. Optimizations: * Matrix creation and manipulation, in both gamnit and the matrix package. * Free pixel data from both Nit and Java memory after loading them from the assets folder into the GPU memory. * Avoids using mallocs in `realtime` services. Fixes: * Fix the left and right anchors of the `UICamera`. * Fix a constant used to ask for antialiasing in the `egl` package. * Avoid long attribute names in Blinn-Phong shader in case their name is truncated or the attribute is optimized out. * Fix pointer to the parent GPU texture name in subtextures. * Improve a few API doc. Pull-Request: #2586 Reviewed-by: Romain Chanoir Reviewed-by: Jean Privat --- f1bc8aa1702044b7bb63023cc84f950bd57b3522 diff --cc lib/gamnit/depth/more_materials.nit index 8de6f9d,96c1484..6674c04 --- a/lib/gamnit/depth/more_materials.nit +++ b/lib/gamnit/depth/more_materials.nit @@@ -93,11 -96,9 +96,11 @@@ class SmoothMateria else glDrawElements(mesh.draw_mode, mesh.indices.length, gl_UNSIGNED_SHORT, mesh.indices_c.native_array) end + + assert glGetError == gl_NO_ERROR end - private fun setup_lights(actor: Actor, model: LeafModel, camera: Camera, program: BlinnPhongProgram) + private fun setup_lights(camera: Camera, program: BlinnPhongProgram) do # TODO use a list of lights