2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-06-30 19:03:42 -04:00

Added raylib-example project

- Separate project to test raylib on its own.
-
This commit is contained in:
2018-07-28 09:26:59 +01:00
parent 1f6735248b
commit 759a652501
9 changed files with 8595 additions and 11 deletions

View File

@ -15,11 +15,13 @@ namespace Raylibcs
{
var options = driver.Options;
var module = options.AddModule("raylib");
module.IncludeDirs.Add("C:\\raylib\\raylib\\release\\include");
// module.IncludeDirs.Add("C:\\raylib\\raylib\\src");
// module.IncludeDirs.Add("C:\\raylib\\raylib\\release\\include");
module.IncludeDirs.Add("C:\\raylib\\raylib\\src");
module.Headers.Add("raylib.h");
// module.Headers.Add("raymath.h");
module.LibraryDirs.Add("C:\\raylib\\raylib\\release\\libs\\win32\\msvc");
module.Headers.Add("rlgl.h");
module.Headers.Add("raymath.h");
// module.Headers.Add("easings.h");
module.LibraryDirs.Add("C:\\raylib\\raylib\\projects\\VS2017\\x64\\Debug.DLL");
module.Libraries.Add("raylib.lib");
var parserOptions = driver.ParserOptions;
@ -28,7 +30,7 @@ namespace Raylibcs
}
void ILibrary.SetupPasses(Driver driver)
{
{
driver.Context.TranslationUnitPasses.RenameDeclsUpperCase(RenameTargets.Any);
// driver.AddTranslationUnitPass(new FunctionToInstanceMethodPass());
// driver.AddTranslationUnitPass(new HandleDefaultParamValuesPass());
@ -37,11 +39,12 @@ namespace Raylibcs
}
public void Preprocess(Driver driver, ASTContext ctx)
{
{
ctx.SetNameOfEnumWithMatchingItem("KEY_UNKOWN", "Key");
ctx.GenerateEnumFromMacros("Flag", "FLAG_(.*)");
ctx.GenerateEnumFromMacros("Key", "KEY_(.*)");
ctx.GenerateEnumFromMacros("Mouse", "MOUSE_(.*)");
ctx.GenerateEnumFromMacros("Colors", "RAYWHITE");
// ctx.GenerateEnumFromMacros("Gamepad", "GAMEPAD_(.*)");
}

View File

@ -7,7 +7,6 @@ namespace Raylibcs
{
class Program
{
// TODO: setup windows forms gui
static void Main(string[] args)
{
Console.WriteLine("Raylib-cs generator");
@ -15,7 +14,7 @@ namespace Raylibcs
while (true)
{
Console.WriteLine();
Console.WriteLine("1. Regenerate bindings in .exe folder");
Console.WriteLine("1. Genertate c# binding code");
Console.WriteLine("2. Run test example, requires raylib.dll in .exe folder");
Console.WriteLine("3. Exit");

View File

@ -54,6 +54,27 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="CppSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>packages\CppSharp.0.8.20\lib\CppSharp.dll</HintPath>
@ -96,7 +117,10 @@
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="dlls\x64\raylib.dll" />
<Content Include="dlls\x86\raylib.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="packages\Baseclass.Contrib.Nuget.Output.2.4.3\build\Baseclass.Contrib.Nuget.Output.targets" Condition="Exists('packages\Baseclass.Contrib.Nuget.Output.2.4.3\build\Baseclass.Contrib.Nuget.Output.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

View File

@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.27703.2035
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs", "Raylib-cs.csproj", "{3B25D9D6-17A6-4A32-B9D1-C637002BD554}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-example", "..\Raylib-example\Raylib-example.csproj", "{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -19,14 +21,26 @@ Global
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Debug|x64.ActiveCfg = Debug|x64
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Debug|x64.Build.0 = Debug|x64
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Debug|x86.ActiveCfg = Debug|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Debug|x86.Build.0 = Debug|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Debug|x86.ActiveCfg = Debug|x86
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Debug|x86.Build.0 = Debug|x86
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Release|Any CPU.Build.0 = Release|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Release|x64.ActiveCfg = Release|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Release|x64.Build.0 = Release|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Release|x86.ActiveCfg = Release|Any CPU
{3B25D9D6-17A6-4A32-B9D1-C637002BD554}.Release|x86.Build.0 = Release|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Debug|x64.ActiveCfg = Debug|x64
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Debug|x64.Build.0 = Debug|x64
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Debug|x86.ActiveCfg = Debug|x86
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Debug|x86.Build.0 = Debug|x86
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Release|Any CPU.Build.0 = Release|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Release|x64.ActiveCfg = Release|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Release|x64.Build.0 = Release|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Release|x86.ActiveCfg = Release|Any CPU
{A2B3BBC8-3D48-46DD-B3CF-263F554E4474}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE