   Can Lua create a SDL_Surface?
  Exactly what the title says. I don't know how it would be done though, since Lua's variables are non-typed.   
  That's not really a problem - if it was, then you wouldn't really be able to use any library with Lua. What happens instead is that you just get back an object that you can treat as an SDL_Surface. It doesn't need to have a specific type as such. Typically in Lua this might be a table containing methods that apply to SDL_Surfaces, plus a Userdata item containing a pointer to the actual surface itself.http://lua-users.org/wiki/LuaModuleLuaSdl;  Ok, thanks. That cleared a lot up.   ;  One slight problem: since Lua can't recognize a SDL_Surface by default, I tried this:int x;int y;SDL_Surface *source = NULL;SDL_Surface *dest = NULL;if (lua_isnumber(LuaVM, 1)){x = lua_tointeger(LuaVM, 1);}if (lua_isnumber(LuaVM, 2)){y = lua_tointeger(LuaVM, 2);}if (lua_islightuserdata(LuaVM, 3)){source = lua_touserdata(LuaVM, 3);}if (lua_islightuserdata(LuaVM, 4)){dest = lua_touserdata(LuaVM, 4);}But when I go to compile it, it gives me:error C2440: '=' : cannot convert from 'void *' to 'struct SDL_Surface *'   Conversion from 'void*' to pointer to non-'void' requires an explicit castIs there an easy way to fix this or am I doing something horribly wrong?   ;  The error message tells it all. The compiler warns you that it cannot cast/convert the pointer type and wants you to explicitely place that cast:source = (SDL_Surface*)lua_touserdata( LuaVM, 3 );