Module event import
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
@@ -4,7 +4,10 @@ project('evol-sandbox', 'c',
|
|||||||
|
|
||||||
evol_dep = dependency('evol')
|
evol_dep = dependency('evol')
|
||||||
|
|
||||||
subproject('evmod_glfw')
|
# subproject('evmod_glfw')
|
||||||
|
evmodglfw_dep = dependency('evmod_glfw')
|
||||||
|
|
||||||
|
sandbox_incdir = []
|
||||||
|
|
||||||
configure_file(input: 'config.lua', output: 'config.lua', copy: true)
|
configure_file(input: 'config.lua', output: 'config.lua', copy: true)
|
||||||
|
|
||||||
@@ -13,8 +16,11 @@ exe = executable(
|
|||||||
'src/main.c',
|
'src/main.c',
|
||||||
dependencies: [
|
dependencies: [
|
||||||
evol_dep,
|
evol_dep,
|
||||||
|
evmodglfw_dep,
|
||||||
],
|
],
|
||||||
install : true,
|
install : true,
|
||||||
|
include_directories: sandbox_incdir,
|
||||||
|
c_args: ['-fms-extensions']
|
||||||
)
|
)
|
||||||
|
|
||||||
test('basic', exe)
|
test('basic', exe)
|
||||||
|
|||||||
4
scratch.md
Normal file
4
scratch.md
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
- Add cross platform timer
|
||||||
|
- Add cross platform sleep function
|
||||||
|
- EV_EXPORT/EV_IMPORT events
|
||||||
|
- Remotery
|
||||||
12
src/main.c
12
src/main.c
@@ -1,8 +1,17 @@
|
|||||||
|
#include "evol/common/ev_macros.h"
|
||||||
|
#include "evol/core/eventlistener.h"
|
||||||
#include <evol/evol.h>
|
#include <evol/evol.h>
|
||||||
#include <evol/evolmod.h>
|
#include <evol/evolmod.h>
|
||||||
#include <evol/common/ev_log.h>
|
#include <evol/common/ev_log.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#define EVENT_MODULE evmod_glfw
|
||||||
|
#include <evol/meta/event_include.h>
|
||||||
|
|
||||||
|
DECLARE_EVENT_LISTENER(windowResizedListener, (WindowResizedEvent *event) {
|
||||||
|
ev_log_info("Window resized: (%d, %d)", event->width, event->height);
|
||||||
|
})
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
evolengine_t *engine = evol_create();
|
evolengine_t *engine = evol_create();
|
||||||
evol_parse_args(engine, argc, argv);
|
evol_parse_args(engine, argc, argv);
|
||||||
@@ -10,6 +19,9 @@ int main(int argc, char **argv) {
|
|||||||
|
|
||||||
evolmodule_t window_module = evol_loadmodule("window");
|
evolmodule_t window_module = evol_loadmodule("window");
|
||||||
assert(window_module);
|
assert(window_module);
|
||||||
|
IMPORT_EVENTS_evmod_glfw(window_module);
|
||||||
|
|
||||||
|
ACTIVATE_EVENT_LISTENER(windowResizedListener, WindowResizedEvent);
|
||||||
|
|
||||||
FN_PTR window_start_fn = evol_getmodfunc(window_module, EV_STRINGIZE(EV_START_FN_NAME));
|
FN_PTR window_start_fn = evol_getmodfunc(window_module, EV_STRINGIZE(EV_START_FN_NAME));
|
||||||
if(window_start_fn) {
|
if(window_start_fn) {
|
||||||
|
|||||||
Reference in New Issue
Block a user