Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8515993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:17:51+00:00 2026-06-11T05:17:51+00:00

I wanted to use OpenGL to do some simple Image processing, so I started

  • 0

I wanted to use OpenGL to do some simple Image processing, so I started off with GLKView. Since I don’t need to refresh the view every few seconds, I didn’t use the GLKViewController and instead used a normal UIViewController subclass.

My question is that do I simply make the viewController’s view as a GLKView or do I add the GLKView as a subview of the view controller’s view. Since I’m adding a UISlider to the view as well, I think the latter seems better, but I’m not sure. I also need to call setNeedsDisplay on the GLKView on certain occasions.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T05:17:53+00:00Added an answer on June 11, 2026 at 5:17 am

    For your rendering, you should really be using GLKView inside a GLKViewController. if you’re worried about not needing to refresh all the time, use self.paused = YES inside your GLKViewController, this will stop the rendering loop, and when you need to render again, simply do self.paused = NO.

    if you’re having the glkview inside another view, you should set it up with containment. in your case, you should have a normal UIView with a normal UIViewController, then add the UISlider and your GLKViewController (with the GLKView) to that.

    After this is done, you can do your normal view stuff in your parent controller, and your opengl stuff is your glk controller.

    A simple example to do this, having setup your parent, which contains the UISlider:

    inside the custom UIViewController for the parent

    @interface ParentViewController () {
        ...
        UISlider *_slider; // this is your slider
        CustomGLKViewController *_myGlkViewController;
    }
    

    then inside viewDidLoad:

    // assuming you're using a storyboard
    UIStoryboard *myStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard"
                                                          bundle:[NSBundle mainBundle]];
    
    
    // setup the opengl controller
    // first get an instance from storyboard
    _myGlkViewController = [myStoryboard instantiateViewControllerWithIdentifier:@"idForGlkViewController"];
    // then add the glkview as the subview of the parent view
    [self.view addSubview:_myGlkViewController.view];
    // add the glkViewController as the child of self
    [self addChildViewController:_myGlkViewController];
    [_myGlkViewController didMoveToParentViewController:self];
    
    // if you want to set the glkView to the same size as the parent view, 
    // or you can do stuff like this inside myGlkViewController
    _myGlkViewController.view.frame = self.view.bounds;
    

    but this is just a simple example to help you get started, you should really go read the apple docs on UIViewController containment for ios5 and the docs for GLKit

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wanted to use a retina resolution image (40x40p) on a bar button item
I wanted to use monotouch, but unfortunately I don't have $400 to spend. So
I just wanted to try out some shaders on a flat image. Turns out
I am currently working on some OSGi application and I wanted to use the
I wanted to use an ExpandableListView for my Fragment but since it's not native,
I wanted to use the fluent interface in Castle Windsor. Since this isn't available
i use jQuery datepicker. i disabled input text and wanted use it as simple
I wanted to use PHP Simple HTML DOM Parser to grab the Google Apps
I have started working on Opencl for a project. I have wanted to use
I wanted to use 6 different textures on a cube, one per side, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.