3

I'm using multiple NSOpenGLViews. All are set as the contentView of an NSWindow that is displayed on it's own screen. All NSOpenGLViews call a method -(void)render:(NSOpenGLView *)sender; declared in the class Scene. This class draws all the vertices.

Everything works fine, but the performance is horrible : with one display, everything is fine (around 500fps). When I add a display, it's extremely slow (around 20fps).

Is it possible to speed things up?

Fatso
  • 1,278
  • 16
  • 46
  • I don't know if this would work or not but try putting `[sender.openGLContext makeCurrentContext]` at the beginning of render methods before drawing. – user1139069 Feb 14 '12 at 05:08
  • That didn't work, but I found an error in my openGL code (forgot a glEnd() ) and everything works great now. On the other hand, performance is horrible. – Fatso Feb 14 '12 at 10:55
  • Can you elaborate on the number of windows and viewports you are rendering too? Is your second display on the same graphics card, or a different GPU? – holtavolt Feb 16 '12 at 22:50
  • 2 windows and 2 viewports, the second display is on the same graphics card. – Fatso Feb 17 '12 at 08:24
  • Is there a reason you need two viewports? Are you trying to display a continuous synced display? If so take a look at CGLX (http://vis.ucsd.edu/~cglx/) or even a long outdated Chromium (not the browser - http://chromium.sourceforge.net/doc/LLNLcopy.html) – platinummonkey Feb 21 '12 at 14:55
  • I'm not very experienced with openGl, but I'm using two windows, one on each screen. Each window has an `NSOpenGLView` with it's own viewport. Is this a wrong thing to do? – Fatso Feb 24 '12 at 08:44

1 Answers1

1

Is it possible that you're fillrate-bound? GPUs are all very well and good, but the pixel pushing is the slowest thing you can ask them to do. What is the framerate when you draw nothing at all on either screen?

The other thing that might be happening is you're getting software emulation. This can happen if your card doesn't support doing something.

geometrian
  • 14,775
  • 10
  • 56
  • 132
  • I'll get back at you soon, I have to find a second display first (just moved to an other town and my TV is at home). – Fatso Feb 18 '12 at 10:41