OpenGL.Core
1.1.122609
dotnet add package OpenGL.Core --version 1.1.122609
NuGet\Install-Package OpenGL.Core -Version 1.1.122609
<PackageReference Include="OpenGL.Core" Version="1.1.122609" />
<PackageVersion Include="OpenGL.Core" Version="1.1.122609" />
<PackageReference Include="OpenGL.Core" />
paket add OpenGL.Core --version 1.1.122609
#r "nuget: OpenGL.Core, 1.1.122609"
#:package OpenGL.Core@1.1.122609
#addin nuget:?package=OpenGL.Core&version=1.1.122609
#tool nuget:?package=OpenGL.Core&version=1.1.122609
OpenGL.Core
OpenGL.Core is a .NET wrapper for the OpenGL graphics library, allowing developers to use OpenGL in C# applications. It provides a managed interface to the native OpenGL API, making it easier to integrate with .NET applications.
How It Works
Initialization:
- Set up an OpenGL context using a windowing library like GLFW or SDL.
- Initialize OpenGL.Core by creating an instance of the
GL
class.
Rendering Loop:
- Create a rendering loop to continuously update and render graphics.
- Use OpenGL.Core methods to issue drawing commands, manage shaders, and handle buffers.
Shaders and Buffers:
- Write vertex and fragment shaders in GLSL.
- Compile and link shaders using OpenGL.Core.
- Create and bind vertex buffer objects (VBOs) and vertex array objects (VAOs) for efficient rendering.
Drawing:
- Clear the screen using
GL.Clear
. - Draw objects using
GL.DrawArrays
orGL.DrawElements
. - Swap buffers to display the rendered frame.
- Clear the screen using
Cleanup:
- Delete shaders, buffers, and other resources when they are no longer needed.
Example
// Initialize OpenGL context
GLFW.Init();
var window = GLFW.CreateWindow(800, 600, "OpenGL.Core Example", IntPtr.Zero, IntPtr.Zero);
GLFW.MakeContextCurrent(window);
GL.LoadBindings(new GLFWBindingsContext());
// Main rendering loop
while (!GLFW.WindowShouldClose(window))
{
// Clear the screen
GL.Clear(ClearBufferMask.ColorBufferBit);
// Render your objects here
// Swap buffers
GLFW.SwapBuffers(window);
GLFW.PollEvents();
}
// Cleanup
GLFW.Terminate();
OpenGL.Core simplifies the process of using OpenGL in C# applications, providing a powerful toolset for graphics programming
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- OpenTK (>= 4.9.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
1.1.122609 | 133 | 3/14/2025 |
1.1.61503 | 117 | 3/14/2025 |
1.0.9911 | 103 | 3/1/2025 |
1.0.9732 | 107 | 3/1/2025 |
Added LoadBindings() method so you can call GLFWBindingsContext!