Пример #1
0
int premake_execute(lua_State* L, int argc, const char** argv)
{
	/* Parse the command line arguments */
	int z = process_arguments(L, argc, argv);

	/* Run the built-in Premake scripts */
	if (z == OKAY)  z = load_builtin_scripts(L);

	return z;
}
Пример #2
0
int premake_execute(lua_State* L, int argc, const char** argv)
{
	int z;

	/* push the absolute path to the Premake executable */
	lua_pushcfunction(L, path_getabsolute);
	premake_locate(L, argv[0]);
	lua_call(L, 1, 1);
	lua_setglobal(L, "_PREMAKE_COMMAND");

	/* Parse the command line arguments */
	z = process_arguments(L, argc, argv);

	/* Run the built-in Premake scripts */
	if (z == OKAY)  z = load_builtin_scripts(L);

	return z;
}
Пример #3
0
ShaderShakerContext * ShaderShakerCreateContext( int argc, const char* const * argv )
{
    ShaderShakerContext
        * context;

    context = new ShaderShakerContext;

    context->L = luaL_newstate();
    luaL_openlibs( context->L );
    lua_pushcfunction( context->L, &HLSLConverter::ParseAst );
    lua_setglobal( context->L, "ParseHLSL" );

    if( load_builtin_scripts( context->L, argc, argv ) )
    {
        return context;
    }
    else
    {
        delete context;
        return 0;
    }
}