Added initial files.
This commit is contained in:
37
src/main.c
Normal file
37
src/main.c
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user