Initial commit

This commit is contained in:
2021-05-21 17:39:11 +02:00
commit 5584a9674a
10 changed files with 102 additions and 0 deletions

1
README.md Normal file
View File

@@ -0,0 +1 @@
# evolmod-template

32
meson.build Normal file
View File

@@ -0,0 +1,32 @@
project('template', 'c',
version : '0.1',
default_options : ['warning_level=3', 'c_std=c11'])
src = subproject('evol').get_variable('evolmod_subdir') + '/meson.build'
dst = meson.current_source_dir() + '/import/'
run_command( 'python3', meson.source_root() + '/subprojects/evol/buildscripts/copy.py', src, dst)
subdir('import')
mod_src = [
'src/template.c',
]
mod_incdir = [
'..',
]
mod_deps = [
evmod_deps,
]
module = shared_module(
'template', mod_src,
include_directories: mod_incdir,
dependencies: mod_deps,
)
mod_dep = declare_dependency(
include_directories: mod_incdir,
)
meson.override_dependency('evmod_template', mod_dep)

1
meson_options.txt Normal file
View File

@@ -0,0 +1 @@
option('moduleconfig', type: 'string', value: 'module.lua')

2
meta/evmod.configvars Normal file
View File

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

3
meta/evmod.events Normal file
View File

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

5
meta/evmod.namespaces Normal file
View File

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

2
meta/evmod.types Normal file
View File

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

6
module.lua Normal file
View File

@@ -0,0 +1,6 @@
{
name = "Template",
version = "0.1",
categories = {"Category1", "Category2"},
dependencies = {"Dependency1", "Dependency2"}
}

43
src/template.c Normal file
View File

@@ -0,0 +1,43 @@
#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);
}

7
subprojects/evol.wrap Normal file
View File

@@ -0,0 +1,7 @@
[wrap-git]
directory = evol
url = https://github.com/evol3d/evol
revision = master
[provide]
dependency_names = evol