Skip to content

Commit

Permalink
Update methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MrScautHD committed Jun 7, 2024
1 parent b1b220c commit 13287f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Raylib-CSharp/Rendering/Gl/Contexts/LinuxGlContext.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Raylib_CSharp.Rendering.Gl.Contexts;
Expand Down Expand Up @@ -51,6 +52,7 @@ public nint GetProcAddress(string procName) {
/// <param name="procName">The name of the OpenGL extension function to retrieve.</param>
/// <returns> A pointer to the address of the extension function if successful; otherwise, returns NULL.</returns>
[LibraryImport(libGL, EntryPoint = "glXGetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static partial nint GetXProcAddress(string procName);

/// <summary>
Expand All @@ -59,6 +61,7 @@ public nint GetProcAddress(string procName) {
/// <param name="procName">The name of the OpenGL extension function to retrieve.</param>
/// <returns> A pointer to the address of the extension function if successful; otherwise, returns NULL.</returns>
[LibraryImport(libGL0, EntryPoint = "glXGetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static partial nint GetXProcAddress0(string procName);

/// <summary>
Expand All @@ -67,5 +70,6 @@ public nint GetProcAddress(string procName) {
/// <param name="procName">The name of the OpenGL extension function to retrieve.</param>
/// <returns> A pointer to the address of the extension function if successful; otherwise, returns NULL.</returns>
[LibraryImport(libGL1, EntryPoint = "glXGetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static partial nint GetXProcAddress1(string procName);
}
2 changes: 2 additions & 0 deletions src/Raylib-CSharp/Rendering/Gl/Contexts/MacGlContext.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Raylib_CSharp.Rendering.Gl.Contexts;
Expand All @@ -12,6 +13,7 @@ public partial class MacGlContext : IGlContext {
/// <param name="procName">The name of the extension function.</param>
/// <returns> A pointer to the extension function if found; otherwise, <see cref="nint.Zero"/>.</returns>
[LibraryImport(OpenGL, EntryPoint = "NSOpenGLGetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static partial nint NSOpenGLGetProcAddress(string procName);

public nint GetProcAddress(string procName) {
Expand Down
5 changes: 5 additions & 0 deletions src/Raylib-CSharp/Rendering/Gl/Contexts/WinGlContext.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Raylib_CSharp.Rendering.Gl.Contexts;
Expand Down Expand Up @@ -40,6 +41,7 @@ public nint GetProcAddress(string procName) {
/// <param name="procName">The name of the extension function.</param>
/// <returns> A pointer to the extension function if successful; otherwise, <see cref="nint.Zero"/>.</returns>
[LibraryImport(OpenGL32, EntryPoint = "wglGetProcAddress", StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static partial nint GetWGLProcAddress(string procName);

/// <summary>
Expand All @@ -51,6 +53,7 @@ public nint GetProcAddress(string procName) {
/// If the function fails, the return value is <see cref="nint.Zero"/>. To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
/// </returns>
[LibraryImport(Kernel32, EntryPoint = "LoadLibraryA", SetLastError = true, StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static partial nint LoadLibrary(string fileName);

/// <summary>
Expand All @@ -64,6 +67,7 @@ public nint GetProcAddress(string procName) {
/// To get extended error information, call <see cref="Marshal.GetLastWin32Error"/>.
/// </returns>
[LibraryImport(Kernel32, EntryPoint = "GetProcAddress", SetLastError = true, StringMarshalling = StringMarshalling.Utf8)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
private static partial nint GetProcAddress(nint module, string procName);

/// <summary>
Expand All @@ -75,6 +79,7 @@ public nint GetProcAddress(string procName) {
/// If the function fails, the return value is false.
/// </returns>
[LibraryImport(Kernel32, EntryPoint = "FreeLibrary", SetLastError = true)]
[UnmanagedCallConv(CallConvs = [typeof(CallConvCdecl)])]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool FreeLibrary(nint module);

Expand Down

0 comments on commit 13287f3

Please # to comment.