OpenGL.Core
1.0.9911
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package OpenGL.Core --version 1.0.9911
NuGet\Install-Package OpenGL.Core -Version 1.0.9911
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OpenGL.Core" Version="1.0.9911" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OpenGL.Core" Version="1.0.9911" />
<PackageReference Include="OpenGL.Core" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OpenGL.Core --version 1.0.9911
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OpenGL.Core, 1.0.9911"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OpenGL.Core@1.0.9911
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OpenGL.Core&version=1.0.9911
#tool nuget:?package=OpenGL.Core&version=1.0.9911
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
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.NET Example", IntPtr.Zero, IntPtr.Zero);
GLFW.MakeContextCurrent(window);
GL.LoadBindings();
// 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
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 |