diff options
| author | jussi | 2022-02-18 18:27:10 +0200 |
|---|---|---|
| committer | jussi | 2022-02-18 18:27:10 +0200 |
| commit | 6e4fdd3b3ae4e4656e151f098c40cfe551a36e8c (patch) | |
| tree | 37e30d371ebd44dfc8bab0d33c26f0294bda5ae4 /src/main.c | |
| parent | 345cc1d5aa3b3c97e2cce453dc65a62c3e05427b (diff) | |
| download | reilua-enhanced-6e4fdd3b3ae4e4656e151f098c40cfe551a36e8c.tar.gz reilua-enhanced-6e4fdd3b3ae4e4656e151f098c40cfe551a36e8c.tar.bz2 reilua-enhanced-6e4fdd3b3ae4e4656e151f098c40cfe551a36e8c.zip | |
Added initial files.
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..e9d5db2 --- /dev/null +++ b/src/main.c @@ -0,0 +1,37 @@ +#include "main.h" +#include "state.h" +#include "lua_core.h" + +int main( int argn, const char **argc ) { + char exePath[ STRING_LEN ] = { '\0' }; + + if ( 1 < argn ) { + if ( strcmp( argc[1], "--version" ) == 0 || strcmp( argc[1], "-v" ) == 0 ) { + printf( "ReiLua %d.%d\n", VERSION_MAJOR, VERSION_MINOR ); + + return 1; + } + else{ + sprintf( exePath, "%s/%s", GetWorkingDirectory(), argc[1] ); + } + } + else { + sprintf( exePath, "%s/", GetWorkingDirectory() ); + } + + stateInit( exePath ); + + while ( state->run ) { + if ( WindowShouldClose() ) { + state->run = false; + } + if ( IsAudioDeviceReady() ) { + UpdateMusicStream( state->music ); + } + luaCallProcess(); + luaCallDraw(); + } + stateFree(); + + return 1; +} |
