Page 1 of 1

OpenRA Fails to run on FreeBSD

Posted: Fri Oct 21, 2011 7:04 pm
by MP2E
I've compiled the latest OpenRA from git according to the guide in INSTALL and I've *nearly* gotten it to run, however, it fails upon loading the OpenGL part of Tao with this error:

Code: Select all

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Tao.OpenGl.Gl ---> System.PlatformNotSupportedException: FreeBSD: Unknown Unix platform - cannot load extensions. Please report a bug at http://taoframework.com
  at Tao.OpenGl.Gl.GetAddress (System.String function) [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl.GetExtensionDelegate (System.String name, System.Type signature) [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl.GetDelegate (System.String name, System.Type signature) [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl.ReloadFunctions () [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at OpenRA.Renderer.SdlCommon.ErrorHandler.CheckGlError () [0x00000] in <filename unknown>:0 
  at OpenRA.Renderer.SdlCommon.SdlGraphics.InitializeSdlGl (System.Drawing.Size& size, WindowMode window, System.String[] requiredExtensions) [0x00000] in <filename unknown>:0 
  at OpenRA.Renderer.Cg.GraphicsDevice..ctor (Size size, WindowMode window) [0x00000] in <filename unknown>:0 
  at OpenRA.Renderer.Cg.DeviceFactory.Create (Size size, WindowMode windowMode) [0x00000] in <filename unknown>:0 
  at OpenRA.Graphics.Renderer.CreateDevice (System.Reflection.Assembly rendererDll, Int32 width, Int32 height, WindowMode window) [0x00000] in <filename unknown>:0 
  at OpenRA.Graphics.Renderer.Initialize (WindowMode windowMode) [0x00000] in <filename unknown>:0 
  at OpenRA.Game.Initialize (OpenRA.Arguments args) [0x00000] in <filename unknown>:0 
  at OpenRA.Program.Run (System.String[] args) [0x00000] in <filename unknown>:0 
  at OpenRA.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: An exception was thrown by the type initializer for Tao.OpenGl.Gl ---> System.PlatformNotSupportedException: FreeBSD: Unknown Unix platform - cannot load extensions. Please report a bug at http://taoframework.com
  at Tao.OpenGl.Gl.GetAddress (System.String function) [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl.GetExtensionDelegate (System.String name, System.Type signature) [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl.GetDelegate (System.String name, System.Type signature) [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl.ReloadFunctions () [0x00000] in <filename unknown>:0 
  at Tao.OpenGl.Gl..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at OpenRA.Renderer.SdlCommon.ErrorHandler.CheckGlError () [0x00000] in <filename unknown>:0 
  at OpenRA.Renderer.SdlCommon.SdlGraphics.InitializeSdlGl (System.Drawing.Size& size, WindowMode window, System.String[] requiredExtensions) [0x00000] in <filename unknown>:0 
  at OpenRA.Renderer.Cg.GraphicsDevice..ctor (Size size, WindowMode window) [0x00000] in <filename unknown>:0 
  at OpenRA.Renderer.Cg.DeviceFactory.Create (Size size, WindowMode windowMode) [0x00000] in <filename unknown>:0 
  at OpenRA.Graphics.Renderer.CreateDevice (System.Reflection.Assembly rendererDll, Int32 width, Int32 height, WindowMode window) [0x00000] in <filename unknown>:0 
  at OpenRA.Graphics.Renderer.Initialize (WindowMode windowMode) [0x00000] in <filename unknown>:0 
  at OpenRA.Game.Initialize (OpenRA.Arguments args) [0x00000] in <filename unknown>:0 
  at OpenRA.Program.Run (System.String[] args) [0x00000] in <filename unknown>:0 
  at OpenRA.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0 
Now, of course this is an issue that Tao needs to fix(not supporting FreeBSD, which should be rather trivial seeing as it's similar to Linux) but I find that the Cg renderer doesn't work either. Why does the Tao OpenGL library need to be loaded if the Cg renderer is enabled? Could a patch be added to "bypass" tao opengl loading when the cg renderer is used?(I suspect this will completely fix OpenRA on FreeBSD)

Thanks for your time!

Posted: Sat Oct 22, 2011 12:04 am
by chrisf
The Tao OpenGL binding is used by both the Cg and GL(SL) renderers.

You probably want to hack Tao.OpenGL (it's on Github) so that it treats *BSD the same as Linux. There's no good reason why it shouldn't work then.