Skip to content

Commit

Permalink
Added MyCSharpLibrary.
Browse files Browse the repository at this point in the history
  • Loading branch information
OmegaExtern committed Oct 20, 2015
1 parent c30f7df commit 5b90355
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions GarrysModLuaShared/GarrysModLuaShared/DllMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ static class DllMain
[DllExport(CallingConvention = CallingConvention.Cdecl)]
public static int gmod13_open(IntPtr luaState)
{
RegisterCFunction(luaState, nameof(MyCSharpLibrary), nameof(MyCSharpLibrary.MyCSharpFunction), MyCSharpLibrary.MyCSharpFunction);
return 0;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<Compile Include="lua_Hook.cs" />
<Compile Include="lua_Reader.cs" />
<Compile Include="lua_Writer.cs" />
<Compile Include="MyCSharpLibrary.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TableIndex.cs" />
<Compile Include="Type.cs" />
Expand Down
14 changes: 14 additions & 0 deletions GarrysModLuaShared/GarrysModLuaShared/MyCSharpLibrary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using static GarrysModLuaShared.Global;

namespace GarrysModLuaShared
{
static class MyCSharpLibrary
{
public static int MyCSharpFunction(IntPtr luaState)
{
print(luaState, "Hello from C# binary module!");
return 0;
}
}
}

0 comments on commit 5b90355

Please sign in to comment.