mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-26 13:08:24 +01:00
SOURCE DUMP v1
This commit is contained in:
parent
bd62d51ec9
commit
fb20299e9d
38 changed files with 768360 additions and 0 deletions
1412
brutal.opengl/Brutal.OpenGl/Constants.gen.cs
Normal file
1412
brutal.opengl/Brutal.OpenGl/Constants.gen.cs
Normal file
File diff suppressed because it is too large
Load diff
25
brutal.opengl/Brutal.OpenGl/Glad.cs
Normal file
25
brutal.opengl/Brutal.OpenGl/Glad.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Brutal.OpenGlApi;
|
||||
|
||||
public static partial class Glad
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes OpenGL by loading the GLAD library and setting up the function pointers for use in C#.
|
||||
/// </summary>
|
||||
/// <returns>True if initialization was successful, otherwise false.</returns>
|
||||
public static unsafe bool Initialize(GlGetProcAddressFunc loader)
|
||||
{
|
||||
var loaderPtr = Marshal.GetFunctionPointerForDelegate(loader);
|
||||
if (LoadGlLoader((nint*)loaderPtr) == 0)
|
||||
return false;
|
||||
|
||||
OpenGl.LoadPointers(entrypointU8 =>
|
||||
{
|
||||
fixed (byte* ptr = entrypointU8)
|
||||
return loader(ptr);
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
20
brutal.opengl/Brutal.OpenGl/Glad.gen.cs
Normal file
20
brutal.opengl/Brutal.OpenGl/Glad.gen.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* @brief Contains generated GLAD functions
|
||||
*
|
||||
* @warning This file is auto-generated by Brutal.OpenGl.Generate.
|
||||
* Do not edit this file directly.
|
||||
* If you want to change the generated code, modify the generation rules.
|
||||
*/
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Brutal.OpenGlApi
|
||||
{
|
||||
public static partial class Glad
|
||||
{
|
||||
[LibraryImport("glad", EntryPoint = "gladLoadGL")]
|
||||
internal static unsafe partial int LoadGl();
|
||||
|
||||
[LibraryImport("glad", EntryPoint = "gladLoadGLLoader")]
|
||||
internal static unsafe partial int LoadGlLoader(nint* value);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,338 @@
|
|||
THIRD-PARTY LICENSE NOTICES
|
||||
RocketWerkz.Brutal.OpenGl
|
||||
|
||||
This package ships one third-party native library, glad, on win-x64, linux-x64 and
|
||||
osx-arm64. It contains no OpenGL implementation - glad resolves OpenGL entry points at
|
||||
run time from the driver already present on the user's system.
|
||||
|
||||
The same Khronos-derived enumerants and entry-point declarations are compiled into the
|
||||
managed assembly Brutal.OpenGl.dll as well: its bindings are generated from glad's
|
||||
header rather than written by hand.
|
||||
|
||||
Three sets of terms govern the code shipped here. All are reproduced in full below.
|
||||
|
||||
|
||||
==============================================================================
|
||||
glad
|
||||
==============================================================================
|
||||
|
||||
Name glad
|
||||
Version 0.1.36
|
||||
Upstream https://github.com/Dav1dde/glad
|
||||
SPDX MIT
|
||||
|
||||
This package ships the loader glad generates, compiled to a shared library. It does
|
||||
not ship the generator. glad's README at tag v0.1.36 carries a section headed "What's
|
||||
the license of glad generated code?", quoted below in its entirety:
|
||||
|
||||
[#101](https://github.com/Dav1dde/glad/issues/101)
|
||||
[#253](https://github.com/Dav1dde/glad/issues/253)
|
||||
|
||||
The glad generated code itself is any of Public Domain, WTFPL or CC0,
|
||||
the source files for the generated code are under various licenses
|
||||
from Khronos.
|
||||
|
||||
* EGL: See [egl.xml](https://github.com/KhronosGroup/EGL-Registry/blob/main/api/egl.xml#L4)
|
||||
* GL: Apache Version 2.0
|
||||
* GLX: Apache Version 2.0
|
||||
* WGL: Apache Version 2.0
|
||||
* Vulkan: Apache Version 2.0 [with exceptions for generated code](https://raw.githubusercontent.com/KhronosGroup/Vulkan-Docs/main/xml/vk.xml)
|
||||
|
||||
Now the Apache License may apply to the generated code (not a lawyer),
|
||||
but see [this clarifying comment](https://github.com/KhronosGroup/OpenGL-Registry/issues/376#issuecomment-596187053).
|
||||
|
||||
Glad also adds header files form Khronos,
|
||||
these have separated licenses in their header.
|
||||
|
||||
glad's own license is reproduced here in full regardless of that answer.
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2013-2021 David Herberth
|
||||
|
||||
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.
|
||||
|
||||
|
||||
==============================================================================
|
||||
Khronos OpenGL API Specification
|
||||
==============================================================================
|
||||
|
||||
Name Khronos OpenGL API specifications, as emitted by glad
|
||||
Version OpenGL 4.6 core profile
|
||||
Upstream https://github.com/KhronosGroup/OpenGL-Registry
|
||||
SPDX Apache-2.0
|
||||
|
||||
The OpenGL enumerants, types and entry-point declarations in the shipped library are
|
||||
generated from the Khronos API specifications. glad's license records these terms:
|
||||
|
||||
Copyright (c) 2013-2020 The Khronos Group Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
That block refers the reader to the Apache License 2.0 rather than reproducing it.
|
||||
The full text follows.
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
|
||||
==============================================================================
|
||||
khrplatform.h
|
||||
==============================================================================
|
||||
|
||||
Name khrplatform.h, from the Khronos EGL Registry
|
||||
Version Khronos commit 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||
Upstream https://github.com/KhronosGroup/EGL-Registry
|
||||
SPDX MIT
|
||||
|
||||
Compiled into the glad library shipped by this package, supplying the scalar and
|
||||
pointer types the OpenGL entry points are declared with.
|
||||
|
||||
glad's license carries a parallel block covering the EGL Registry headers, stating
|
||||
copyright 2007-2016. The notice below is taken instead from the copy of khrplatform.h
|
||||
this package was built from, which states 2008-2018.
|
||||
|
||||
Copyright (c) 2008-2018 The Khronos Group Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and/or associated documentation files (the
|
||||
"Materials"), to deal in the Materials without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
permit persons to whom the Materials are 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 Materials.
|
||||
|
||||
THE MATERIALS ARE 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
|
||||
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
5387
brutal.opengl/Brutal.OpenGl/Loader.gen.cs
Normal file
5387
brutal.opengl/Brutal.OpenGl/Loader.gen.cs
Normal file
File diff suppressed because it is too large
Load diff
1381
brutal.opengl/Brutal.OpenGl/OpenGl.cs
Normal file
1381
brutal.opengl/Brutal.OpenGl/OpenGl.cs
Normal file
File diff suppressed because it is too large
Load diff
4532
brutal.opengl/Brutal.OpenGl/OpenGl.gen.cs
Normal file
4532
brutal.opengl/Brutal.OpenGl/OpenGl.gen.cs
Normal file
File diff suppressed because it is too large
Load diff
3
brutal.opengl/Brutal.OpenGl/Types/GlAttribute.cs
Normal file
3
brutal.opengl/Brutal.OpenGl/Types/GlAttribute.cs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
public record struct GlAttribute(uint Location, int Count, GlEnum Type, GlScaling Behavior, int Stride, int Offset);
|
||||
10
brutal.opengl/Brutal.OpenGl/Types/GlBehavior.cs
Normal file
10
brutal.opengl/Brutal.OpenGl/Types/GlBehavior.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public enum GlBehavior : uint
|
||||
{
|
||||
Fastest = GL_FASTEST,
|
||||
Nicest = GL_NICEST,
|
||||
DontCare = GL_DONT_CARE,
|
||||
}
|
||||
21
brutal.opengl/Brutal.OpenGl/Types/GlBindTarget.cs
Normal file
21
brutal.opengl/Brutal.OpenGl/Types/GlBindTarget.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public enum GlBindTarget : uint
|
||||
{
|
||||
ArrayBuffer = GL_ARRAY_BUFFER,
|
||||
AtomicCounterBuffer = GL_ATOMIC_COUNTER_BUFFER,
|
||||
CopyReadBuffer = GL_COPY_READ_BUFFER,
|
||||
CopyWriteBuffer = GL_COPY_WRITE_BUFFER,
|
||||
DispatchIndirectBuffer = GL_DISPATCH_INDIRECT_BUFFER,
|
||||
DrawIndirectBuffer = GL_DRAW_INDIRECT_BUFFER,
|
||||
ElementArrayBuffer = GL_ELEMENT_ARRAY_BUFFER,
|
||||
PixelPackBuffer = GL_PIXEL_PACK_BUFFER,
|
||||
PixelUnpackBuffer = GL_PIXEL_UNPACK_BUFFER,
|
||||
QueryBuffer = GL_QUERY_BUFFER,
|
||||
ShaderStorageBuffer = GL_SHADER_STORAGE_BUFFER,
|
||||
TextureBuffer = GL_TEXTURE_BUFFER,
|
||||
TransformFeedbackBuffer = GL_TRANSFORM_FEEDBACK_BUFFER,
|
||||
UniformBuffer = GL_UNIFORM_BUFFER,
|
||||
}
|
||||
10
brutal.opengl/Brutal.OpenGl/Types/GlBitfield.cs
Normal file
10
brutal.opengl/Brutal.OpenGl/Types/GlBitfield.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public record struct GlBitfield(uint Id)
|
||||
{
|
||||
public static implicit operator uint(GlBitfield value) => value.Id;
|
||||
|
||||
public static implicit operator GlBitfield(uint value) => new(value);
|
||||
}
|
||||
12
brutal.opengl/Brutal.OpenGl/Types/GlBuffer.cs
Normal file
12
brutal.opengl/Brutal.OpenGl/Types/GlBuffer.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public readonly record struct GlBuffer(uint Id)
|
||||
{
|
||||
public unsafe GlBuffer Bind(GlBindTarget target)
|
||||
{
|
||||
Native.glBindBuffer((uint)target, this);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
16
brutal.opengl/Brutal.OpenGl/Types/GlBufferUsage.cs
Normal file
16
brutal.opengl/Brutal.OpenGl/Types/GlBufferUsage.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public enum GlBufferUsage : uint
|
||||
{
|
||||
StreamDraw = GL_STREAM_DRAW,
|
||||
StreamRead = GL_STREAM_READ,
|
||||
StreamCopy = GL_STREAM_COPY,
|
||||
StaticDraw = GL_STATIC_DRAW,
|
||||
StaticRead = GL_STATIC_READ,
|
||||
StaticCopy = GL_STATIC_COPY,
|
||||
DynamicDraw = GL_DYNAMIC_DRAW,
|
||||
DynamicRead = GL_DYNAMIC_READ,
|
||||
DynamicCopy = GL_DYNAMIC_COPY,
|
||||
}
|
||||
42
brutal.opengl/Brutal.OpenGl/Types/GlCapability.cs
Normal file
42
brutal.opengl/Brutal.OpenGl/Types/GlCapability.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGlApi.OpenGl;
|
||||
|
||||
public enum GlCapability : uint
|
||||
{
|
||||
Blend = GL_BLEND,
|
||||
ClipDistance0 = GL_CLIP_DISTANCE0,
|
||||
ClipDistance1 = GL_CLIP_DISTANCE1,
|
||||
ClipDistance2 = GL_CLIP_DISTANCE2,
|
||||
ClipDistance3 = GL_CLIP_DISTANCE3,
|
||||
ClipDistance4 = GL_CLIP_DISTANCE4,
|
||||
ClipDistance5 = GL_CLIP_DISTANCE5,
|
||||
ClipDistance6 = GL_CLIP_DISTANCE6,
|
||||
ClipDistance7 = GL_CLIP_DISTANCE7,
|
||||
ColorLogicOp = GL_COLOR_LOGIC_OP,
|
||||
CullFace = GL_CULL_FACE,
|
||||
DebugOutput = GL_DEBUG_OUTPUT,
|
||||
DebugOutputSynchronous = GL_DEBUG_OUTPUT_SYNCHRONOUS,
|
||||
DepthClamp = GL_DEPTH_CLAMP,
|
||||
DepthTest = GL_DEPTH_TEST,
|
||||
Dither = GL_DITHER,
|
||||
FramebufferSrgb = GL_FRAMEBUFFER_SRGB,
|
||||
LineSmooth = GL_LINE_SMOOTH,
|
||||
Multisample = GL_MULTISAMPLE,
|
||||
PolygonOffsetFill = GL_POLYGON_OFFSET_FILL,
|
||||
PolygonOffsetLine = GL_POLYGON_OFFSET_LINE,
|
||||
PolygonOffsetPoint = GL_POLYGON_OFFSET_POINT,
|
||||
PolygonSmooth = GL_POLYGON_SMOOTH,
|
||||
PrimitiveRestart = GL_PRIMITIVE_RESTART,
|
||||
PrimitiveRestartFixedIndex = GL_PRIMITIVE_RESTART_FIXED_INDEX,
|
||||
RasterizerDiscard = GL_RASTERIZER_DISCARD,
|
||||
SampleAlphaToCoverage = GL_SAMPLE_ALPHA_TO_COVERAGE,
|
||||
SampleAlphaToOne = GL_SAMPLE_ALPHA_TO_ONE,
|
||||
SampleCoverage = GL_SAMPLE_COVERAGE,
|
||||
SampleShading = GL_SAMPLE_SHADING,
|
||||
SampleMask = GL_SAMPLE_MASK,
|
||||
ScissorTest = GL_SCISSOR_TEST,
|
||||
StencilTest = GL_STENCIL_TEST,
|
||||
TextureCubeMapSeamless = GL_TEXTURE_CUBE_MAP_SEAMLESS,
|
||||
ProgramPointSize = GL_PROGRAM_POINT_SIZE,
|
||||
}
|
||||
11
brutal.opengl/Brutal.OpenGl/Types/GlClearBit.cs
Normal file
11
brutal.opengl/Brutal.OpenGl/Types/GlClearBit.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
[Flags]
|
||||
public enum GlClearBit : uint
|
||||
{
|
||||
Color = GL_COLOR_BUFFER_BIT,
|
||||
Depth = GL_DEPTH_BUFFER_BIT,
|
||||
Stencil = GL_STENCIL_BUFFER_BIT,
|
||||
}
|
||||
8
brutal.opengl/Brutal.OpenGl/Types/GlEnum.cs
Normal file
8
brutal.opengl/Brutal.OpenGl/Types/GlEnum.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
public record struct GlEnum(uint Id)
|
||||
{
|
||||
public static implicit operator uint(GlEnum value) => value.Id;
|
||||
|
||||
public static implicit operator GlEnum(uint value) => new(value);
|
||||
}
|
||||
10
brutal.opengl/Brutal.OpenGl/Types/GlFace.cs
Normal file
10
brutal.opengl/Brutal.OpenGl/Types/GlFace.cs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public enum GlFace : uint
|
||||
{
|
||||
Front = GL_FRONT,
|
||||
Back = GL_BACK,
|
||||
FrontAndBack = GL_FRONT_AND_BACK,
|
||||
}
|
||||
3
brutal.opengl/Brutal.OpenGl/Types/GlFramebuffer.cs
Normal file
3
brutal.opengl/Brutal.OpenGl/Types/GlFramebuffer.cs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
public record struct GlFramebuffer(uint Id);
|
||||
9
brutal.opengl/Brutal.OpenGl/Types/GlFrontFace.cs
Normal file
9
brutal.opengl/Brutal.OpenGl/Types/GlFrontFace.cs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public enum GlFrontFace : uint
|
||||
{
|
||||
Clockwise = GL_CW,
|
||||
CounterClockwise = GL_CCW,
|
||||
}
|
||||
15
brutal.opengl/Brutal.OpenGl/Types/GlFunc.cs
Normal file
15
brutal.opengl/Brutal.OpenGl/Types/GlFunc.cs
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
namespace Brutal.OpenGlApi;
|
||||
|
||||
using static OpenGl;
|
||||
|
||||
public enum GlFunc : uint
|
||||
{
|
||||
Never = GL_NEVER,
|
||||
Less = GL_LESS,
|
||||
LessEqual = GL_LEQUAL,
|
||||
Greater = GL_GREATER,
|
||||
GreaterEqual = GL_GEQUAL,
|
||||
Equal = GL_EQUAL,
|
||||
NotEqual = GL_NOTEQUAL,
|
||||
Always = GL_ALWAYS,
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue