本文整理汇总了C#中System.IntPtr.glua_pushinteger方法的典型用法代码示例。如果您正苦于以下问题:C# IntPtr.glua_pushinteger方法的具体用法?C# IntPtr.glua_pushinteger怎么用?C# IntPtr.glua_pushinteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IntPtr
的用法示例。
在下文中一共展示了IntPtr.glua_pushinteger方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Open
public static int Open(IntPtr L)
{
L.glua_settop(0); // Remove weird constants
L.PushGFunction(GLua.EmptyGFunc);
L.PushGFunction(GLua.EmptyGFunc);
L.PushGFunction(GLua.EmptyGFunc);
L.PushGFunction(GLua.EmptyGFunc);
L.PushGFunction(GLua.EmptyGFunc);
Kernel32.AllocConsole();
Console.Title = "Garry's Mod";
GLuaDynamic _GD = new GLuaDynamic(L);
dynamic _G = _GD;
_GD.Dbg();
L.CreateType(typeof(Cart));
_GD.Dbg();
GLua.Utils.DoString(L, "TESTVAR = 256; function TESTFUNC(...) Cart.Console(...) print(...) end");
_GD.Dbg();
_G.TESTFUNC("Hello from DLR! ", 42);
_G.TESTFUNC(_G.TESTVAR);
L.SetGlobalTableGFunc("_G", "SpewMsg", GLua.EmptyGFunc);
bool InHook = false;
GLua.Utils.HookOutput(new GSpewOutputFunc((int T, string Str, int R, int G, int B, int A) => {
if (InHook)
return;
InHook = true;
L.Locked(() => {
L.PushSpecial(SPECIAL.GLOB);
L.glua_getfield(-1, "SpewMsg");
L.glua_pushinteger(R);
L.glua_pushinteger(G);
L.glua_pushinteger(B);
L.glua_pushinteger(A);
L.glua_pushstring(Str);
if (L.PCall(5, 0, 0) != 0)
GLua.Utils.print(L, L.CheckString(-1));
});
InHook = false;
}));
L.Locked(() => {
if (L.gluaL_loadstring("function TEST_DUMP() print(\"Hello universe!\") end") != 0)
Console.WriteLine(L.CheckString(-1));
if (L.glua_pcall(0, 0, 0) != 0)
Console.WriteLine(L.CheckString(-1));
});
/*L.GetTableVal("_G", "TEST_DUMP");
L.glua_dump((LPtr, Dump, Size, UData) => { // TODO: Fix, what is this shit.
string Str = Marshal.PtrToStringAnsi(Dump, (int)Size);
Console.WriteLine("{0} >> \"{1}\"", Size, Str);
return 0;
});*/
GLua.Utils.print(L, string.Format("Test with ManagedWrapper v{0} loaded", ManagedWrapper.VERSION), false);
return 0;
}