May 13, 2014

OpenGL and Cocoa Framework in OSx/iOS

tutorials on OpenGL and GLKit in iOS:

Good introduction:

Simple and fast start:

A quick summary:

Apple's own guideline to use vertex data efficiently:

Adding custom subview:

iOS: init with storyboard
  UIStoryboard *myStoryboard = [UIStoryboard storyboardWithName:@"main"                                                           bundle:[NSBundle mainBundle]];
 // setup the opengl controller
    // first get an instance from storyboard
    self.glkViewController = [myStoryboard instantiateViewControllerWithIdentifier:@"glkviewcontroller"]; 
    // then add the glkview as the subview of the parent view
    [self.view addSubview: self.glkViewController.view];

Mac OS: init with nib

    SettingsViewController* settingsController = [[SettingsViewController alloc]      initWithNibName:@"SettingsViewController"
                 bundle:[NSBundle mainBundle]
      withDefaultValues: self.graphPanel.chartType
              withColor: self.graphPanel.colorScheme

               dataType: self.attr];