VeliV's picture

Using second monitor on Mac OSX Snow Leopard

Project:The Open Toolkit library
Category:bug report

The following code:

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

Creates the GameWindow on the same device as default. So changing the displaydevice has no effect on Mac OSX. Using the latest versions of the OSX on the following setup:

# 2.8GHz Intel Core 2 Duo
# 4GB 1066MHz DDR3 SDRAM - 2x2GB
# NVIDIA GeForce 9400M + 9600M GT with 512MB


Comment viewing options

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


Title:Using secnod monitor on Mac OSX Snow Leopard» Using second monitor on Mac OSX Snow Leopard

Forum topic about the issue.

the Fiddler's picture


Status:open» confirmed

We need to bind and call CGDisplayBounds to get the actual bounds of the display.

kanato's picture


This was something I never implemented, because I had no way to test it out. Particularly if one wants to go full screen with a context, a display device must be specified when the context is created. It looks like the API has changed though, to allow specification of a display device when creating a graphics context. In that case, one needs to modify the call to DMGetGDeviceByDisplayID in AglContext.cs.

VeliV's picture


If you tell me preciscely what you need to change there I can test it out and report back :)

kanato's picture


Ok, I think I've fixed this in rev. 2481. It should now detect the proper bounds for the specified device. If it doesn't work, can you add the following line to the beginning of your code (before OpenTK is initialized or anything in OpenTK is used), and post the output?

System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(System.Console.Out));

Also, I have included a hack in rev. 2482 to allow OpenTK to specify the device to AGL that was used to create GameWindow. This should allow one to have a full screen context on a specified display device, if you could test that too I'd appreciate it.

The "correct" way to do this would be to specify the device to the GraphicsContext constructor, but I'm not sure it's worth changing the API at that level when this sort of hack should work fine.

the Fiddler's picture


Version:0.9.9-3» 0.9.x-dev
Status:confirmed» fixed

I am marking this as fixed, but please reopen if the issue remains in 1.0 beta-2.

the Fiddler's picture


Version:0.9.x-dev» 1.0-beta-2
Status:fixed» closed

Closing issues fixed in 1.0 beta-2.