Android update and small improvements

-fixed code do cross compiling to android
-fixed build with GCC (workaround)
-added little benchmark
-several small fixes
-updated meson build (demos building, working with GCC, LDC and DMD)
-added some meson options
-added ImGUI bind for OpenGL3
This commit is contained in:
Mergul 2020-06-01 11:24:50 +02:00
parent 86edfa4a57
commit 66860b9042
30 changed files with 1358 additions and 173 deletions

View file

@ -906,7 +906,8 @@ export struct EntityManager
input_data.thread_id = cast(typeof(input_data.thread_id))threadID();
}//*/
static foreach (iii, comp_info; components_info.req)
///FIXME: should be "components_info.req()" but it's not compile with GCC
static foreach (iii, comp_info; components_info.m_req[0 .. components_info.m_req_counter])
{
__traits(getMember, input_data, comp_info.name) = (cast(ForeachType!(typeof(__traits(getMember,
Sys.EntitiesData, comp_info.name)))*)(
@ -914,7 +915,7 @@ export struct EntityManager
.. entities_count];
}
static foreach (iii, comp_info; components_info.optional)
static foreach (iii, comp_info; components_info.m_optional[0 .. components_info.m_optional_counter])
{
if (system.m_optional_components[iii] < info.deltas.length
&& info.deltas[system.m_optional_components[iii]] != 0)
@ -1344,9 +1345,9 @@ export struct EntityManager
"Can't call function with system which hasn't EntitesData structure.");
static assert(__traits(hasMember, Sys, "onUpdate"),
"Can't call function with system which hasn't onUpdate function callback.");
static assert(is(SetFunctionAttributes!(T, functionLinkage!(s.onUpdate),
functionAttributes!(s.onUpdate)) == typeof(&s.onUpdate)),
"Function must match system update function.");
// static assert(is(SetFunctionAttributes!(T, functionLinkage!(s.onUpdate),
// functionAttributes!(s.onUpdate)) == typeof(&s.onUpdate)),
// "Function must match system update function."); FIXME: It's lead to crash on android build
static assert(__traits(hasMember, Sys, "system_id"), "Sys must be system type.");
System* system = getSystem(Sys.system_id);
@ -3105,7 +3106,7 @@ export struct EntityManager
// has_work |= removeEntities();
has_work |= updateEvents();
//id_manager.optimize();
id_manager.optimize();
has_work |= updateBlocks();
has_work |= changeEntities();
has_work |= removeEntities();