I am having trouble running the lua interpreter at the same time im running sdl and am also having trouble with processing events in sdl while lua is embedded basically in some pseudo code this is what it looks like so far
#include <lua.hpp>
#include <SDL/SDL.h>
#include "user.hpp"
int main(int argc,char ** argv){
SDL_Event * Event;
lua_State *L;
L = lua_open();
luaL_openlibs(L);
int x=0;
while(x=0){
lua_interpret(L); // a user created function
user.sdlinit(); // another user function to initialize sdl
while(SDL_PollEvent(Event);
user.event(Event); // user function to parse events
}
}
lua_close();
SDL_Quit();
return 0;
}
do note that its a little bit more messy than what I made it to look.
It compiles fine with no errors even with -Wall however when i run the program it segfaults. I double checked there doesn't seem to be any access violations all pointers are set to null upon initialization.
I just need some advice as to what may have occured even though it might not be apparent in the pseudo code above.
oh and before anyone asks no this is not for a game its just a proof of concept as i'm looking to use lua for configuration.