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

  • Home
  • SEARCH
  • 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 4618826
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:20:36+00:00 2026-05-22T02:20:36+00:00

I am making a simple game (using the book iPhone and iPad Game Development

  • 0

I am making a simple game (using the book “iPhone and iPad Game Development for Dummies), but I cannot get it to work. I am making the sample application that is used in the book, so I think I have the correct code. Here is the problem.

I put in the code for OpenGL ES, but I am getting a lot of warnings. Here is the code.

.h file:

#import <UIKit/UIKit.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <QuartzCore/QuartzCore.h>
#import <CoreGraphics/CoreGraphics.h>

@interface OpenGL : UIView {
EAGLContext *context;
GLuint *framebuffer;
GLuint *colorRenderBuffer;
GLuint *depthBuffer;
}

- (void) prepareOpenGL;
- (void) render;

@end

.m file:

#import "OpenGL.h"


@implementation OpenGL

- (void) awakeFromNib; {
    [self prepareOpenGL];
    [self render];
}

- (void) prepareOpenGL; {
    context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
    [EAGLContext setCurrentContext:context];

    glGenFramebuffers(1, &framebuffer);
    glBindFramebuffer(GL_RENDERBUFFER, framebuffer);
    glGenRenderbuffers(1, &colorRenderBuffer);
    glBindRenderbuffer(GL_RENDERBUFFER, colorRenderBuffer);
[context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer*)self.layer];
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, colorRenderBuffer);

GLint height, width;
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &width);
glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &height);

glGenRenderbuffers(1, &depthBuffer);
glBindRenderbuffer(GL_RENDERBUFFER, depthBuffer);
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, width, height);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer);

GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER);
if (status != GL_FRAMEBUFFER_COMPLETE) {
    NSLog(@"Failed to create a complete render buffer!");
}
}

- (void) render; {
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glViewport(0, 0, self.bounds.size.width, self.bounds.size.height);
glClearColor(0.5, 0.0, 0.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);

glBindRenderbuffer(GL_RENDERBUFFER, colorRenderBuffer);
[context presentRenderbuffer:GL_RENDERBUFFER];
}

+ (Class) layerClass; {
    return [CAEAGLLayer class];
}

These are the types of warnings I am getting (I cannot put them all in because there are a lot of them):

Passing argument 2 of 'glGenFramebuffers' from incompatible pointer type.
Passing argument 2 of 'glBindFramebuffers' from incompatible pointer type.
Passing argument 2 of 'glGenRenderbuffers' from incompatible pointer type.
Passing argument 2 of 'glBindRenderbuffers' from incompatible pointer type.

So, if all of this came out of the book, why am I getting these warnings? Am I not importing the right files? I really cannot give you much more information than this because I have no idea about what caused this, and I am totally new to OpenGL ES. Thanks for any and all help!

EDIT: One more thing. I get the warnings wherever things like glGenFramebuffers are used.

  • 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-05-22T02:20:36+00:00Added an answer on May 22, 2026 at 2:20 am

    The glGen* functions take a size and a pointer to a GLuint, and you’re passing the address of a pointer to a GLuint (a GLuint **), which is what triggers the warning.

    Just pass the pointer directly, like this:

    glGenFramebuffers(1, framebuffer);
    glGenRenderbuffers(1, colorRenderBuffer);
    glGenRenderbuffers(1, depthBuffer);

    Also don’t forget to allocate memory before passing it to OpenGL.

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

Sidebar

Related Questions

I'm making a simple high scores database for an iPhone game using Amazon's SimpleDB
I'm making a simple 2D game for the iPhone. It's based on CrashLanding. so
I'm making a very simple game application. The main form (Form1) has a single
I'm making an iPhone game and using UIView objects to draw sprites. Most of
I am making a simple game in order to learn a new language. I
I'm making a simple 2 player game in XNA and started looking into saving
If I'm making a simple grid based game, for example, I might have a
I'm making a simple tool that will get a string of MySQL commands and
I am thinking of making a simple game engine for my course final year
I am making a simple console game in C++ I would like to know

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.