Added initial files.

This commit is contained in:
jussi
2022-02-18 18:27:10 +02:00
parent 345cc1d5aa
commit 6e4fdd3b3a
53 changed files with 27310 additions and 0 deletions

37
src/main.c Normal file
View File

@@ -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;
}