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')
|
||||
|
||||
subproject('evmod_glfw')
|
||||
# subproject('evmod_glfw')
|
||||
evmodglfw_dep = dependency('evmod_glfw')
|
||||
|
||||
sandbox_incdir = []
|
||||
|
||||
configure_file(input: 'config.lua', output: 'config.lua', copy: true)
|
||||
|
||||
@@ -13,8 +16,11 @@ exe = executable(
|
||||
'src/main.c',
|
||||
dependencies: [
|
||||
evol_dep,
|
||||
evmodglfw_dep,
|
||||
],
|
||||
install : true,
|
||||
include_directories: sandbox_incdir,
|
||||
c_args: ['-fms-extensions']
|
||||
)
|
||||
|
||||
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/evolmod.h>
|
||||
#include <evol/common/ev_log.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) {
|
||||
evolengine_t *engine = evol_create();
|
||||
evol_parse_args(engine, argc, argv);
|
||||
@@ -10,6 +19,9 @@ int main(int argc, char **argv) {
|
||||
|
||||
evolmodule_t window_module = evol_loadmodule("window");
|
||||
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));
|
||||
if(window_start_fn) {
|
||||
|
||||
Reference in New Issue
Block a user