Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 14th, 2012  |  syntax: None  |  size: 0.49 KB  |  hits: 30  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Use NSScrollView together with Cocos2d-mac (NSOpenGLView)
  2. appDelegate = [[NSApplication sharedApplication] delegate];
  3. // Set up NSScrollView with dummy empty view as big as the layer
  4. NSRect rect = NSMakeRect(0, 0, myLayer.width, myLayer.height);
  5. NSView *view = [[NSView alloc] initWithFrame:rect];
  6. appDelegate.scrollView.documentView = view;
  7. [view release];
  8.  
  9. // Push OpenGLView back to front
  10. [appDelegate.glView removeFromSuperview];  
  11. [appDelegate.splitLeftView addSubview:appDelegate.glView];