Add Premake and FFI Bindings

This commit is contained in:
GuilhermeWerner
2021-02-24 09:13:18 -03:00
parent 36df99c7e0
commit 74532a9ace
14 changed files with 399 additions and 0 deletions

12
Examples/C/Hello.c Normal file
View File

@ -0,0 +1,12 @@
// Copyright (c) TribuFu. All Rights Reserved
#include "stdio.h"
#include "TribuFu.h"
extern int32_t Hello(void);
int main()
{
printf("TribuFu SDK = %d\n", Hello());
}

24
Examples/CSharp/Hello.cs Normal file
View File

@ -0,0 +1,24 @@
// Copyright (c) TribuFu. All Rights Reserved
using System;
using System.Runtime.InteropServices;
namespace CSharp
{
class Program
{
#if WINDOWS_PLATFORM
const string TribuFu = "TribuFu";
#else
const string TribuFu = "libTribuFu";
#endif
[DllImport(TribuFu)]
public static extern int Hello();
public static void Main(string[] args)
{
Console.WriteLine("TribuFu SDK = " + Hello());
}
}
}

14
Examples/Cpp/Hello.cpp Normal file
View File

@ -0,0 +1,14 @@
// Copyright (c) TribuFu. All Rights Reserved
#include <iostream>
#include "TribuFu.h"
using namespace std;
extern int32_t Hello();
int main()
{
cout << "TribuFu SDK = " << (int)TribuFu::Hello() << "\n";
}