VeliV's picture

Weird behaviour on MacBook Pro running Monodevelop

Hello!

First post here :) Started looking into OpenTK and it seem quite interesting. I just have some minor troubles that gets really annyoing after awhile.

Running the QuickStart project works quite well and I am able to edit the code and get visual changes. My problem though is that the new window that is created is made under the main monodevelop window. That means that I have to minimize monodevelop everytime I want to see the gamewindow. There also is no icon for it in the dock, so it is quite hard to close it. I can't close it with keyboard for some reason (I suspect that is because monodevelop has the focus).

I have a second monitor set up. Could I somehow easily move the gamewindow to that screen?


Comments

Comment viewing options

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

Hi, and welcome!

The main issue with the Mac port is that (a) I don't have access to a Mac and (b) noone is reporting issues such as these! In other words, thanks for taking the time to report the issues you are seeing. :)

I'd appreciate it if you could post actual issue reports for each of these problems, adding some information about your system (OS version, OpenTK version, CPU, video card).

Regarding the second monitor, the main idea is to use a GameWindow constructor that takes a DisplayDevice parameter.

class MyGame : GameWindow
{
    public MyGame()
        : base(width, height, GraphicsMode.Default, "title", DisplayDevice.AvailableDisplays[1])
    { }
}

In theory, this should automatically center the window on the second monitor, but I doubt this has been ever tested on Mac OS X (please file a bug if it doesn't work!)

An alternative solution is to create the window on the first monitor and move it to the second afterwards:

using (var game = new GameWindow())
{
    game.Location = DisplayDevice.AvailableDisplays[1].Bounds.Location; // top-left of the second monitor
}

With OpenTK 1.0 is coming in about a month, there's more than enough time to get the Mac port up to speed - as long as we are aware of the issues!

VeliV's picture

Actually, neither of those worked :)

			DisplayDevice[] devices = DisplayDevice.AvailableDisplays;
 
			for (int i = 0; i < devices.Length; i++ )
			{
			    Console.WriteLine(devices[i].Bounds.ToString());
			}

Results in

{X=0,Y=0,Width=1440,Height=900}
{X=0,Y=0,Width=1680,Height=1050}

So, setting it to bounds is the same as
base.Location = new Point(0,0);
which moves the screen to the origo of 1st screen.

I am able to change this by ginving the point negative values, but that's kind of a dirty fix.

I'll add an issue to it.