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:
@@ -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>
|
@@ -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.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user