Closed devel0 closed 4 years ago
The examples won't work on your machine as the data you provided indicates that the Mesa implementation on your system only supports OpenGL 2.1. Our samples are built around OpenGL 3.3
If you would like to try Silk out in this environment, you'll need to use Silk.NET.OpenGL.Legacy (and the old fixed-function pipeline, which was deprecated in OpenGL 3) and modify the GraphicsAPI in your WindowOptions.
Thanks!
Found a way to make it work in Virtualbox OpenGL 3.3 using mesa software driver from here ; it's not hardware accelerated but enough for crossplatform tests I needed.
[DllImport("kernel32")]
public static extern IntPtr LoadLibrary(string path);
void InitGL()
{
var opts = WindowOptions.Default;
opts.IsVisible = false;
// if need to use mesa driver ( ie. windows guest on virtualbox )
// download driver from https://fdossena.com/?p=mesa/index.frag)
// and set OPENGL_LIBRARY_PATH to the folder containing Opengl32.dll
var mesa_lib_path = Environment.GetEnvironmentVariable("OPENGL_LIBRARY_PATH", EnvironmentVariableTarget.User);
if (mesa_lib_path is not null)
{
var lib_pathfilename = Path.Combine(mesa_lib_path, "opengl32.dll");
if (File.Exists(lib_pathfilename))
{
LoadLibrary(lib_pathfilename);
}
}
glContext = Silk.NET.Windowing.Window.Create(opts);
glContext.Initialize();
// https://github.com/Ultz/Silk.NET/issues/66
glContext.IsVisible = false;
GL = GL.GetApi(glContext);
// ...
}
Summary of feature
Trying to run hello quad on virtualbox win guest in linux host with 3d accel enabled I got
Unhandled exception. Silk.NET.GLFW.GlfwException: VersionUnavailable: WGL: Failed to create OpenGL context
Comments
Trying to run the gears example of glfw in virtualbox it works without any problem. I tried to replace glfw3.dll generated file into silknet example but nothing changes, full error follow:
Attached XML containing details of graphic card as seen from inside virtualbox generted with glview
glview-SVGA3D; build_ RELEASE; .XML.txt