add a scanner, but this seems to be a wrong solution. Change open-source head
This commit is contained in:
@@ -1,30 +1,10 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------------
|
||||
// file="glApiManager.Load"
|
||||
// Project: StgSharp
|
||||
// AuthorGroup: Nitload Space
|
||||
// Copyright (c) Nitload Space. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
// -----------------------------------------------------------------------
|
||||
// -----------------------------------------------------------------------
|
||||
// Copyright (c) Nitload.
|
||||
// SPDX-License-Identifier: MIT
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
using StgSharp.Mathematics;
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
@@ -36,7 +16,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore10(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core10)
|
||||
{
|
||||
@@ -103,7 +84,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore11(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core11)
|
||||
{
|
||||
@@ -145,7 +127,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore12(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core12)
|
||||
{
|
||||
@@ -172,7 +155,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore13(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core13)
|
||||
{
|
||||
@@ -208,7 +192,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore14(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core14)
|
||||
{
|
||||
@@ -244,7 +229,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore15(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core15)
|
||||
{
|
||||
@@ -289,7 +275,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore20(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core20)
|
||||
{
|
||||
@@ -467,7 +454,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore21(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core21)
|
||||
{
|
||||
@@ -498,7 +486,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore30(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core30)
|
||||
{
|
||||
@@ -667,7 +656,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore31(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core31)
|
||||
{
|
||||
@@ -715,7 +705,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore32(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core32)
|
||||
{
|
||||
@@ -765,7 +756,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore33(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core33)
|
||||
{
|
||||
@@ -836,7 +828,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore40(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core40)
|
||||
{
|
||||
@@ -938,7 +931,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore41(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core41)
|
||||
{
|
||||
@@ -1130,7 +1124,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore42(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core42)
|
||||
{
|
||||
@@ -1172,7 +1167,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore43(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core43)
|
||||
{
|
||||
@@ -1278,7 +1274,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore44(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core44)
|
||||
{
|
||||
@@ -1315,7 +1312,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore45(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core45)
|
||||
{
|
||||
@@ -1550,7 +1548,8 @@ namespace StgSharp.Graphics.OpenGL
|
||||
|
||||
internal static unsafe bool LoadGLcore46(
|
||||
glContextShadow* contextPtr,
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load)
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load
|
||||
)
|
||||
{
|
||||
if (!core46)
|
||||
{
|
||||
@@ -1576,7 +1575,10 @@ namespace StgSharp.Graphics.OpenGL
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private static unsafe IntPtr LoadGLFunction(delegate*<ReadOnlySpan<byte>, IntPtr> load, ReadOnlySpan<byte> name)
|
||||
private static unsafe IntPtr LoadGLFunction(
|
||||
delegate*<ReadOnlySpan<byte>, IntPtr> load,
|
||||
ReadOnlySpan<byte> name
|
||||
)
|
||||
{
|
||||
IntPtr ptr = load(name);
|
||||
if (ptr == IntPtr.Zero) {
|
||||
|
||||
Reference in New Issue
Block a user