Initial commit
This commit is contained in:
32
meson.build
Normal file
32
meson.build
Normal 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
1
meson_options.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
option('moduleconfig', type: 'string', value: 'module.lua')
|
||||||
2
meta/evmod.configvars
Normal file
2
meta/evmod.configvars
Normal 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
3
meta/evmod.events
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
PRIMARY(PrimaryEvent, { U32 dummy_primary; })
|
||||||
|
|
||||||
|
SECONDARY(PrimaryEvent, SecondaryEvent, { U32 dummy_secondary; })
|
||||||
5
meta/evmod.namespaces
Normal file
5
meta/evmod.namespaces
Normal 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
2
meta/evmod.types
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
TYPE(TypeA, { I32 member1, F32 member2; })
|
||||||
|
TYPE(TypeB, { PTR memberX, STR memberY; })
|
||||||
6
module.lua
Normal file
6
module.lua
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
name = "Template",
|
||||||
|
version = "0.1",
|
||||||
|
categories = {"Category1", "Category2"},
|
||||||
|
dependencies = {"Dependency1", "Dependency2"}
|
||||||
|
}
|
||||||
43
src/template.c
Normal file
43
src/template.c
Normal 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
7
subprojects/evol.wrap
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[wrap-git]
|
||||||
|
directory = evol
|
||||||
|
url = https://github.com/evol3d/evol
|
||||||
|
revision = master
|
||||||
|
|
||||||
|
[provide]
|
||||||
|
dependency_names = evol
|
||||||
Reference in New Issue
Block a user