Added specialization

Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
2021-05-21 19:16:32 +02:00
parent 5584a9674a
commit 97fa6cd6f4
8 changed files with 20 additions and 59 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
tags*
import

View File

@@ -1,4 +1,4 @@
project('template', 'c', project('evol-mod-assetmanager', 'c',
version : '0.1', version : '0.1',
default_options : ['warning_level=3', 'c_std=c11']) default_options : ['warning_level=3', 'c_std=c11'])
@@ -8,7 +8,7 @@ run_command( 'python3', meson.source_root() + '/subprojects/evol/buildscripts/co
subdir('import') subdir('import')
mod_src = [ mod_src = [
'src/template.c', 'src/mod.c',
] ]
mod_incdir = [ mod_incdir = [
@@ -20,7 +20,7 @@ mod_deps = [
] ]
module = shared_module( module = shared_module(
'template', mod_src, 'evmodassetmanager', mod_src,
include_directories: mod_incdir, include_directories: mod_incdir,
dependencies: mod_deps, dependencies: mod_deps,
) )
@@ -29,4 +29,4 @@ mod_dep = declare_dependency(
include_directories: mod_incdir, include_directories: mod_incdir,
) )
meson.override_dependency('evmod_template', mod_dep) meson.override_dependency('evmod_assets', mod_dep)

View File

@@ -1,2 +0,0 @@
EV_CONFIG_VAR(template_var1, I32, 0)
EV_CONFIG_VAR(template_var2, SDS, "Default")

View File

@@ -1,3 +0,0 @@
PRIMARY(PrimaryEvent, { U32 dummy_primary; })
SECONDARY(PrimaryEvent, SecondaryEvent, { U32 dummy_secondary; })

View File

@@ -1,5 +0,0 @@
EV_NS_DEF_BEGIN(Namespace1)
EV_NS_DEF_FN(U32, update, (F32, deltaTime))
EV_NS_DEF_END(Namespace1)

View File

@@ -1,2 +0,0 @@
TYPE(TypeA, { I32 member1, F32 member2; })
TYPE(TypeB, { PTR memberX, STR memberY; })

14
src/mod.c Normal file
View File

@@ -0,0 +1,14 @@
#define EV_MODULE_DEFINE
#include <evol/evolmod.h>
EV_CONSTRUCTOR
{
}
EV_DESTRUCTOR
{
}
EV_BINDINGS
{
}

View File

@@ -1,43 +0,0 @@
#define EV_MODULE_DEFINE
#include <evol/evolmod.h>
#include <stdio.h>
EV_CONSTRUCTOR
{
printf("Loaded template module\n");
}
U32
update(
F32 deltaTime)
{
EV_UNUSED_PARAM(deltaTime);
return 0;
}
EV_DESTRUCTOR
{
printf("Unloaded template module\n");
}
EVMODAPI bool
export_and(
bool x,
bool y)
{
return x & y;
}
EVMODAPI bool
export_or(
bool x,
bool y)
{
return x | y;
}
EV_BINDINGS
{
EV_NS_BIND_FN(Namespace1, update, update);
}