2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-09-09 03:01:41 -04:00

Bump .NET Version from 5 to 8

This commit is contained in:
yoyoyodog123
2024-01-11 20:44:06 -06:00
parent a94a92afb6
commit 48a1439fd9
5 changed files with 23 additions and 33 deletions

View File

@@ -1,23 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<StartupObject>Examples.Program</StartupObject>
<RunWorkingDirectory>$(MSBuildThisFileDirectory)</RunWorkingDirectory>
<LangVersion>10</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Core/LoadingThread.cs"/>
<Compile Remove="Text/Unicode.cs"/>
<Compile Remove="Core/LoadingThread.cs" />
<Compile Remove="Text/Unicode.cs" />
</ItemGroup>
<ItemGroup>
<Using Include="Raylib_cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="../Raylib-cs/Raylib-cs.csproj" />
<ProjectReference Include="../Raylib-cs.Native/Raylib-cs.Native.csproj" />

View File

@@ -1,17 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
<PackageReference Include="coverlet.collector" Version="1.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Raylib-cs\Raylib-cs.csproj" />
</ItemGroup>
</Project>
</Project>

View File

@@ -1,13 +1,13 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs", "Raylib-cs\Raylib-cs.csproj", "{236DB383-2FDC-4A77-8B33-22122D9B8950}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raylib-cs", "Raylib-cs\Raylib-cs.csproj", "{236DB383-2FDC-4A77-8B33-22122D9B8950}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Raylib-cs.Tests", "Raylib-cs.Tests\Raylib-cs.Tests.csproj", "{1341D222-7E10-42C6-BC6E-4A46C934A843}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Raylib-cs.Tests", "Raylib-cs.Tests\Raylib-cs.Tests.csproj", "{1341D222-7E10-42C6-BC6E-4A46C934A843}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples", "Examples\Examples.csproj", "{1E2A5986-3F11-457F-AF97-D0C08D0060BA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples", "Examples\Examples.csproj", "{1E2A5986-3F11-457F-AF97-D0C08D0060BA}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<EnableDefaultItems>false</EnableDefaultItems>
<AssemblyName>Raylib-cs</AssemblyName>
<RootNamespace>Raylib_cs</RootNamespace>
@@ -9,7 +9,6 @@
<NoWarn>$(NoWarn);1591</NoWarn>
<LangVersion>10.0</LangVersion>
</PropertyGroup>
<PropertyGroup>
<Authors>Chris Dill, Raysan5</Authors>
<PackProject>true</PackProject>
@@ -27,19 +26,14 @@
<PackageProjectUrl>https://www.raylib.com/</PackageProjectUrl>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<None Include="logo/raylib-cs_64x64.png" Pack="true" PackagePath="" />
<None Include="../README.md" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="System.Numerics.Vectors" Version="4.5.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
<Import Project="./Build.props" />
<ItemGroup>
<Content Include="runtimes/**" Link="runtimes/%(RecursiveDir)/%(Filename)%(Extension)">
<PackagePath>runtimes/</PackagePath>
@@ -47,7 +41,6 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Compile Include="interop\*.cs" />
<Compile Include="types\*.cs" />
@@ -56,4 +49,4 @@
<Compile Include="types\native\Utf8Buffer.cs" />
<Compile Include="types\native\FilePathList.cs" />
</ItemGroup>
</Project>
</Project>

View File

@@ -11,15 +11,16 @@ public readonly struct CBool
* they only support a single bit, yes, but the minimum storage unit of a
* computer is a sbyte, so that's what we'll be using when doing operations,
* which can be later implicitely cast onto any type during usage.
*
*
* It is wise to note that C booleans are any numeric value, but allocating an
* Int64 for every CBool instance is.. well, wildly memory-inefficient. Yes, the
* process is basically treated as a 0-cost instantiation, but it's better to rely
* on explicit motivation than to blindly trust the runtime judgement on its memory
* management.
*
* management.
*
* 'value' is visible and constructable (if necessary), but impossible to modify or access.
*/
public sbyte Value
{
init; private get;
@@ -30,13 +31,14 @@ public readonly struct CBool
{
this.Value = (sbyte)(value ? 1 : 0);
}
public CBool(Int64 value)
{
this.Value = (sbyte)(value != 0 ? 1 : 0);
}
// CBool -> Native
// Allows for arithmetic between CBools and for assignment to greater integer variables.
// CBool -> Native Allows for arithmetic between CBools and for assignment to greater integer
// variables.
public static implicit operator sbyte(CBool x)
{
return x.Value;
@@ -45,11 +47,11 @@ public readonly struct CBool
// Allows for CBools to be implicitely assigned to a native boolean variable.
public static implicit operator bool(CBool x)
{
return x.Value != 0 ? true : false;
return x.Value != 0;
}
// Native -> CBool
// Allows native booleans to be implicitely constructed into CBools while passing parameters.
// Native -> CBool Allows native booleans to be implicitely constructed into CBools while
// passing parameters.
public static implicit operator CBool(bool x)
{
return new CBool { Value = (sbyte)(x ? 1 : 0) };
@@ -64,7 +66,7 @@ public readonly struct CBool
/* Arithmetic overloads
* Operations between CBools and integers are already covered by the implicit
* sbyte cast. So no need to worry about those.
*
*
* All casts return CBool, since there is no way to know if the assignment is
* to a native boolean or integer, or a CBool.
*/