-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
6,015 additions
and
5,926 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.
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,11 @@ | ||
namespace Raylib_CSharp.OpenGL.Contexts; | ||
|
||
public interface IBindingsContext { | ||
|
||
/// <summary> | ||
/// Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). | ||
/// </summary> | ||
/// <param name="procName">The name of the exported function or variable.</param> | ||
/// <returns>The address of the exported function or variable.</returns> | ||
nint GetProcAddress(string procName); | ||
} |
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,10 @@ | ||
namespace Raylib_CSharp.OpenGL; | ||
|
||
public struct GLSync { | ||
|
||
public nint Value; | ||
|
||
public GLSync(nint value) { | ||
this.Value = value; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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,11 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<RootNamespace>Raylib_CSharp.OpenGL</RootNamespace> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
|
||
</Project> |
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,44 @@ | ||
using Raylib_CSharp.OpenGL.Contexts; | ||
using Raylib_CSharp.Rendering.Gl.Contexts; | ||
|
||
namespace Raylib_CSharp.Test; | ||
|
||
public class NativeBindingsContext : IDisposable, IBindingsContext { | ||
|
||
private NativeGlContext _context; | ||
|
||
public bool HasDisposed { get; private set; } | ||
|
||
/// <summary> | ||
/// Represents a context for native bindings in OpenGL. | ||
/// </summary> | ||
public NativeBindingsContext() { | ||
this._context = new NativeGlContext(); | ||
} | ||
|
||
public nint GetProcAddress(string procName) { | ||
return this._context.GetProcAddress(procName); | ||
} | ||
|
||
/// <summary> | ||
/// Disposes of the object, allowing for proper resource cleanup and finalization. | ||
/// </summary> | ||
public void Dispose() { | ||
if (this.HasDisposed) return; | ||
|
||
this.Dispose(true); | ||
GC.SuppressFinalize(this); | ||
this.HasDisposed = true; | ||
} | ||
|
||
/// <summary> | ||
/// Releases the managed resources used by the object (disposing), and optionally releases the unmanaged. | ||
/// resources (not disposing). | ||
/// </summary> | ||
/// <param name="disposing">A boolean value indicating whether the method is being called from, dispose method directly (true) or from the finalizer (false).</param> | ||
protected void Dispose(bool disposing) { | ||
if (disposing) { | ||
this._context.Dispose(); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.