-
-
Notifications
You must be signed in to change notification settings - Fork 416
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the June 2021 Update (v2.5.0) with production-ready OpenXR (#505
) * Add helper for making XrGraphicsBindingOpenGL* instances, start XR demo * Fix OpenXR flags being 32-bit not 64-bit, "almost" working OpenXR demo * Pushing latest demo - crosseyed is gone, replaced with weird fov thing * Add maths helpers, is this progress I don't even know anymore * Commit before rewrite * Scrap the demo * Stop us forgetting to ship bindings! * Add missing bindings to SLN and missing typemaps, update changelog * Update src/Core/Silk.NET.Core/Native/SilkMarshal.cs Co-authored-by: Kai Jellinghaus <[email protected]> * Bindings updates, fix release notes * Update Silk.NET.sln Co-authored-by: Kai Jellinghaus <[email protected]>
- Loading branch information
1 parent
c26e41b
commit 765c172
Showing
79 changed files
with
2,565 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
|
||
namespace Silk.NET.Core | ||
{ | ||
/// <summary> | ||
/// A 64-bit version structure. | ||
/// </summary> | ||
public readonly struct Version64 | ||
{ | ||
/// <summary> | ||
/// The underlying OpenXR-compatible 64-bit version integer. | ||
/// </summary> | ||
public ulong Value { get; } | ||
|
||
/// <summary> | ||
/// Creates a OpenXR version structure from the given major, minor, and patch values. | ||
/// </summary> | ||
/// <param name="major">The major value.</param> | ||
/// <param name="minor">The minor value.</param> | ||
/// <param name="patch">The patch value.</param> | ||
public Version64(uint major, uint minor, uint patch) | ||
=> Value = ((major & 0xffffUL) << 48) | ((minor & 0xffffUL) << 32) | (patch & 0xffffffffUL); | ||
|
||
/// <summary> | ||
/// Creates a OpenXR version structure from the given OpenXR-compatible value. | ||
/// </summary> | ||
/// <param name="value">The value.</param> | ||
private Version64(ulong value) => Value = value; | ||
|
||
/// <summary> | ||
/// Gets the major component of this version structure. | ||
/// </summary> | ||
public uint Major => (uint) ((Value >> 48) & 0xffffUL); | ||
|
||
/// <summary> | ||
/// Gets the minor component of this version structure. | ||
/// </summary> | ||
public uint Minor => (uint) ((Value >> 32) & 0xffffUL); | ||
|
||
/// <summary> | ||
/// Gets the patch component of this version structure. | ||
/// </summary> | ||
public uint Patch => (uint) (Value & 0xffffffffUL); | ||
|
||
/// <summary> | ||
/// Creates a 64-bit version structure from the given 64-bit unsigned integer. | ||
/// </summary> | ||
/// <param name="val">The uint value.</param> | ||
/// <returns>The 64-bit version structure.</returns> | ||
public static explicit operator Version64(ulong val) => new(val); | ||
|
||
/// <summary> | ||
/// Creates a 64-bit version structure from the given managed version class. | ||
/// </summary> | ||
/// <param name="version">The version instance.</param> | ||
/// <returns>The 64-bit version structure.</returns> | ||
public static implicit operator Version64 | ||
(Version version) => new((uint) version.Major, (uint) version.Minor, (uint) version.Build); | ||
|
||
/// <summary> | ||
/// Gets the 64-bit unsigned integer representation for this 64-bit version structure. | ||
/// </summary> | ||
/// <param name="version">The 64-bit version structure.</param> | ||
/// <returns>The 64-bit unsigned integer.</returns> | ||
public static implicit operator ulong(Version64 version) => version.Value; | ||
|
||
/// <summary> | ||
/// Converts this 64-bit version structure to a managed version class. | ||
/// </summary> | ||
/// <param name="version">The 64-bit version structure.</param> | ||
/// <returns>The managed representation.</returns> | ||
public static implicit operator Version | ||
(Version64 version) => new((int) version.Major, (int) version.Minor, (int) version.Patch); | ||
} | ||
} |
Oops, something went wrong.