Zaneris's picture

Linux Issues

Just started messing around with OpenTK to test out its cross-platform capabilities, made a small test project.

The project runs perfectly fine on Windows, and building results in an application that runs fine outside of the mono debugger; on linux however (Ubuntu 12.10 specifically) , it runs fine within monodevelop, on debug and release, with and without the debugger, but the packaged project does not.

I can see the mouse moved to the center of the screen (which is called in GameWindow OnLoad) and then nothing...

Any ideas?


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
AndyKorth's picture

Sounds like it got pretty far. You can try enabling the some additional debugging information and see if your packaged app prints anything:

               TextWriterTraceListener console = new TextWriterTraceListener(System.Console.Out);
                Trace.Listeners.Add (console);

I've had some limited success getting standalone opentk applications to run on a Mac- the challenges there were usually getting it to launch. Although it's possible that your test project just gets far enough until it calls something that's missing- like a call that it would need to find inside your opengl32.dll or something... Sort of grasping at straws, but maybe that can help.

djk's picture

On Linux you have to make a call that loads the threaded X libs in a certain order, I can't remember what it is off the top of my head and I do not have my work laptop handy right now to check. It was discussed on the forum about 2 years ago.


I found an early version of what we did, it has to be called as the first thing in Main. after that the default single threaded XLibs may get instantiated and its to late.

public static void Main(string[] args)
// Use an OpenTK method before calling Application.Init().
// This ensures XInitThreads() is called.

Zaneris's picture

Thanks djk! That did it.

djk's picture

Your welcome!