Martin Kristiansen
Martin Kristiansen

Reputation: 10222

Clean OpenGL support on MacOS X with multiple monitor fullscreen

I'm working on an OpenGL based application. I've been using GLUT for setting up the screen, but have encountered a problem.

When attaching a second monitor I would like to setup another window with another viewport, but using glut I can only setup one fullscreenview, that spans both monitors.

My question is, How do I setup two fullscreen windows under MacOSX, what do I need to use? It looks like this is not posible under GLUT, do I need to use X11 or can I use some more native framework.

Upvotes: 3

Views: 653

Answers (1)

Ken Thomases
Ken Thomases

Reputation: 90551

You should use an NSWindow with either an NSOpenGLView or a NSView with a manually-associated NSOpenGLContext as its content view. Here's Apple's documentation with example code. In that example, it uses [NSScreen mainScreen]. You can examine the array returned by [NSScreen screens] and pick a different screen.

Upvotes: 2

Related Questions