Rendering problems in windows, no OpenGL 2.0 available

I'm in the process of evaluating UrhoSharp for visualisation in our windows and mobile applications. The goal is to combine as much of the codebase as possible.

While all seems good with mobile (xamarin forms) and my development environment (windows 10 inside a vmware fusion vm on a macbook), I tested the the resulting windows binaries on serveral machines with mixed results.

On about half of the machines it runs as expected, on some it crashes instantly. I got this log from one of these machines
[Mon Jul 18 18:02:19 2016] INFO: Opened log file Urho3D.log [Mon Jul 18 18:02:19 2016] INFO: Created 7 worker threads [Mon Jul 18 18:02:19 2016] INFO: Added resource package F:/Debug/CoreData.pak **[Mon Jul 18 18:02:19 2016] ERROR: OpenGL 2.0 is required** [Mon Jul 18 18:02:19 2016] INFO: Set screen mode 761x518 windowed [Mon Jul 18 18:02:19 2016] INFO: Initialized input [Mon Jul 18 18:02:19 2016] INFO: Initialized user interface

I suspect UrhoSharp requires OpenGL 2.0 to run? Is there any fallback option?

Thanks

Answers

  • EgorBoEgorBo BYXamarin Team ✭✭✭
    edited July 2016

    @ChristopherStaerkel UrhoSharp supports Urho on Windows with DirectX11 renderer, it can be built via:
    make libUrho3D.a -f MakeWindows TARGET="Visual Studio 14" RENDERER=D3D11
    unfortunately it's not possible to switch renderers dynamically so we decided to distribute UrhoSharp for windows with Opengl for better compatibility with Android and iOS (same glsl shaders). However, UrhoSharp for UWP uses DX11.

  • ChristopherStaerkelChristopherStaerkel DEMember ✭✭

    @EgorBo thanks for the quick reply! I'll try to give it a go. Anything else that needs to be set up if I also want 32bit builds?

  • EgorBoEgorBo BYXamarin Team ✭✭✭

    @ChristopherStaerkel said:
    @EgorBo thanks for the quick reply! I'll try to give it a go. Anything else that needs to be set up if I also want 32bit builds?

    Regarding 32bit on windows it's a bit tricky, see https://forums.xamarin.com/discussion/comment/210348/#Comment_210348

  • ChristopherStaerkelChristopherStaerkel DEMember ✭✭

    @EgorBo said:
    @ChristopherStaerkel UrhoSharp supports Urho on Windows with DirectX11 renderer, it can be built via:
    make libUrho3D.a -f MakeWindows TARGET="Visual Studio 14" RENDERER=D3D11

    I followed the instructions on https://github.com/xamarin/urho
    However, I hit a roadblock in Visual Studio when I tried to compile the project MonoUrho.Windows after issuing
    make libUrho3D.a -f MakeWindows TARGET="Visual Studio 14" RENDERER=D3D11

    I get the following output in visual studio:

    1> Library "..\..\..\Bin\Desktop\Win32\mono-urho.lib" and object "..\..\..\Bin\Desktop\Win32\mono-urho.exp" are being created. 1>Urho3D.lib(D3D11Graphics.obj) : error LNK2001: unresolved external symbol "[email protected]". 1>Urho3D.lib(D3D11Graphics.obj) : error LNK2001: unresolved external symbol "_IID_IDXGIAdapter". 1>Urho3D.lib(D3D11Graphics.obj) : error LNK2001: unresolved external symbol "_IID_IDXGIFactory". 1>Urho3D.lib(D3D11Graphics.obj) : error LNK2001: unresolved external symbol "_IID_IDXGIDevice". 1>Urho3D.lib(D3D11Graphics.obj) : error LNK2001: unresolved external symbol "_IID_IDXGIDevice1". 1>Urho3D.lib(D3D11ShaderVariation.obj) : error LNK2001: unresolved external symbol "[email protected]". 1>Urho3D.lib(D3D11ShaderVariation.obj) : error LNK2001: unresolved external symbol "[email protected]". 1>Urho3D.lib(D3D11ShaderVariation.obj) : error LNK2001: unresolved external symbol "[email protected]". 1>..\..\..\Bin\Desktop\Win32\mono-urho.dll : fatal error LNK1120: 8 unresolved external symbols

    Any pointers how to proceed from here are greatly appreciated. Also if someone has a working build environment and could provide a 32 bit mono-urho.dll with Direct3D rendering enabled I'd be in heaven :-)

  • EgorBoEgorBo BYXamarin Team ✭✭✭
    edited July 2016

    @ChristopherStaerkel sorry I forgot, you will have to do this in order to compile mono-urho.dll for DX11:
    1) execute
    make libUrho3D.a -f MakeWindows TARGET="Visual Studio 14" RENDERER=D3D11
    2) open properties at UrhoSharp.Windows project
    3) open Linker\Input
    4) paste (replace) this to "Additional Dependencies":
    kernel32.lib;user32.lib;gdi32.lib;winspool.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;comdlg32.lib;advapi32.lib;$(ProjectDir)..\lib\Urho3D_d.lib;winmm.lib;imm32.lib;version.lib;ws2_32.lib;dbghelp.lib;d3dcompiler.lib;d3d11.lib;dxgi.lib;dxguid.lib
    5) openAllUrho.h
    and remove "#if defined(UWP)" line (and #endif).
    I'll add a new configuration to this project for DirectX later.

  • ChristopherStaerkelChristopherStaerkel DEMember ✭✭

    Thanks for your reply! I have some progress: With the instructions above I'm able to build in Debug mode. However, when I copy the resulting mono-urho.dll in the bin folder of my eval project and replace the dll provided with the nuget package, I get the following exception at runtime

    ************** Exception Text **************
    System.EntryPointNotFoundException: Unable to find an entry point named 'RegisterMonoRefCountedCallback' in DLL 'mono-urho'.
       at Urho.Runtime.RegisterMonoRefCountedCallback(MonoRefCountedCallback callback)
       at Urho.Runtime.Start()
       at Urho.Application.ProxyStart(IntPtr h)
       at Urho.Application.Application_Run(IntPtr handle)
       at Urho.Application.Run()
       at UrhoSharpEval.Form1.<btnRun_Click>d__3.MoveNext() in X:\UrhoSharpEval\UrhoSharpEval\Form1.cs:line 36
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.<ThrowAsync>b__6_0(Object state)
    `
    

    When I try to compile in Release configuration I get tons of errors relating to binding.obj:
    LNK2038: mismatch detected for "_ITERATOR_DEBUG_LEVEL": value "2" doesn't match value "0" in binding.obj LNK2038: mismatch detected for "_RuntimeLibrary": value "2" doesn't match value "0" in binding.obj
    and so on.

  • EgorBoEgorBo BYXamarin Team ✭✭✭
    edited July 2016

    @ChristopherStaerkel it looks like you are trying to use mono-urho.dll compiled from the current master with UrhoSharp via nuget 1.0.557.
    There are two options:
    1) use also Urho.dll compiled from master
    2) reset master to a commit when 1.0.557 was released

    Because RegisterMonoRefCountedCallback was renamed recently. but Urho C# from nuget still expects it to see.

  • ChristopherStaerkelChristopherStaerkel DEMember ✭✭

    @EgorBo yes, I did not take into account that master is more recent than the nuget release - thanks for pointing that out. Do you happen to know which commit I need for 1.0.557?

    Thanks!

  • EgorBoEgorBo BYXamarin Team ✭✭✭

    @ChristopherStaerkel said:
    @EgorBo yes, I did not take into account that master is more recent than the nuget release - thanks for pointing that out. Do you happen to know which commit I need for 1.0.557?

    Thanks!

    You can try this one: 829b813bfbcdfbd5c4a36338a54afa7d117c828b

Sign In or Register to comment.