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 8819637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:24:41+00:00 2026-06-14T05:24:41+00:00

I am learning OpenGLES and I am trying to put a GLKViewer inside an

  • 0

I am learning OpenGLES and I am trying to put a GLKViewer inside an UIViewController.

I know I can come around the main issues by using GLViewController, but I am trying to learn how to do it this way.

I found this question, Nesting GLKView into UIViewController and Nested GLKView and GLKViewController but I must be missing something even though I think I am doing all the right steps because when I run my project, I am not getting to the drawInRect print line.

In the storyboard I am pointing the ViewController as the delegate of the glkview component.

I tried to keep the code as simple as possible and any help will be apreciated:

MyController.h

#import <Foundation/Foundation.h>
#import <GLKit/GLKit.h>

@interface MyGLController : UIViewController <GLKViewDelegate>
{
    GLuint vertexBufferID;

}

@property (weak, nonatomic) IBOutlet GLKView *glview;

@property (strong, nonatomic) GLKBaseEffect *baseEffect;

@end

MyGLController.m

#import "MyGLController.h"

@implementation MyGLController

//@synthesize baseEffect;

-(void) viewDidLoad{
    [super viewDidLoad];

    self.glview.context = [[EAGLContext alloc] initWithAPI:
     kEAGLRenderingAPIOpenGLES2];

     [EAGLContext setCurrentContext:self.glview.context];
    printf("View Loaded");
}


- (void)glkView:(GLKView *)view drawInRect:(CGRect)rect
{
    printf("DrawInRect");
}

@end

* Update *

As far as I can tell the glkview is hooked up properly as suggested per and added the josh-knapp and called setNeedsDisplay.

In case there’s something I am missing, I have uploaded a copy of the project here: https://github.com/jcrogel/OpenGLDebug.git

I am a total noob in this so I apologize for any silly oversight 🙂

  • 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-14T05:24:42+00:00Added an answer on June 14, 2026 at 5:24 am

    You didn’t say you hooked up the glview property of MyGLController in the storyboard, so verify that.

    Next, you’re setting up the glview context after it loads. Without a GLKViewController, there is nothing telling the glview it needs to be drawn. Make sure you call [self.glview setNeedsDisplay] somewhere after the context is set up.

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

Sidebar

Related Questions

Learning xml, Can anyone help me? I have following XML code: **<book lang=en>name of
Learning how to do a master page in asp.net. Trying to figure out how
I'm learning OpenGL ES. When I'm using texture for triangle, I meet error. Here
learning html/css here. I can't seem to understand how to tweak this drop down
Learning C and I'm trying to get a visual comparison of the variable types
Learning how to test is HARD! I'm just trying to get MiniTest running and
Learning about Explicit Cursors and trying to create my frst one.: SET SERVEROUTPUT ON
I am learning opengl es 2.0. I am trying to apply ortho projection in
I had recently starting learning openGLES and right now I had gone through some
Learning jquery, so please be kind :) Using PHP, I have a table with

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.