OpenGL.Net
OpenGL.Net copied to clipboard
Nothing works out of the box when I clone the repo and try and run the samples.
There's no install bat in the root of the directory. There's no instructions in the readme. There's a bunch of sln projects, but all for old vs versions, so not sure which one to use.
Gaaarh
I not sure what you mean exacly.
install what install? i just connect OpenGL.Net\OpenGL.Net_netstd2.0.csproj
- netstd2.0 - net standart work probality on all platforms. i not use Windows .NET 4.x and platform dependes (Win Forms, etc.)
sln... sorry i use VS code and notepad++ :) no sln.
but if you need start working with OpenGL.NET -
i use SFML for create window, inputs, etc... and use .NET 5.0 (new .NET it all in one - net standart, net core, etc.)
in csproj file:
<ProjectReference Include="..\OpenGL.Net\OpenGL.Net\OpenGL.Net_netstd2.0.csproj" />
/ + add package SFML
in code:
using SFML;
using SFML.Window;
using OpenGL;
in main
Gl.Initialize(); // OpenGL.NET
Window window = new Window(new VideoMode(800,600),"test"); // SFML
window.SetActive(); // SFML
Gl.BindAPI(); // OpenGL.NET
while (window.IsOpen) // SFML
{
window.DispatchEvents();
// INSERT YOU OPENGL COMMANDS HERE....
Gl.Clear(ClearBufferMask.ColorBufferBit);
Gl.Begin(PrimitiveType.Triangles);
Gl.Color3(1.0f, 0.0f, 0.0f); Gl.Vertex2(0.0f, 0.0f);
Gl.Color3(0.0f, 1.0f, 0.0f); Gl.Vertex2(0.5f, 1.0f);
Gl.Color3(0.0f, 0.0f, 1.0f); Gl.Vertex2(1.0f, 0.0f);
Gl.End();
// --------------
window.Display(); // SFML -- not sure what this doing... but need
}
I have a similar problem. I am trying to use this library with the NuGet package of this. I fail to reference/access important classes, for example
new OpenGL.GlControl();
it just can't find/access the class for some reason. Same was the case for Vertex3f, I just couldn't access it.
I will try SFML! @SuperDIMMaX your little test program works great, thank you!
I not use nuget only local copy of repro. nuget only have compiled dll - monoandroid, net35, net461
SFML - only create window for GL content, you probality can use SDL2 or samiliar...
Not use OpenGL.Net.CoreUI and etc. for create window (or use self writen WPF manager(or... find) if need only Windows)
I not use OpenGL.GlControl() .... new OpenGL.GlControl();
- not important ) this is OpenGL.Net.WinForms .... addon as OpenGL.Net.CoreUI and how i see not maintenance and not uptodate (
on that moment i just setup VAO, FBO, etc ...
I will try SFML!
And try not mix SFML graphics and Opengl.NET - not use any SFML.Graphics to avoid problems - texture load, render text, ... use only SFML.Window / Audio.
Vertex3f - Gl.Vertex3()
- this class have 8 ovverides for double, float, short, int