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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:59:57+00:00 2026-06-13T16:59:57+00:00

XCode has the ability to capture Opengl ES frames from the iPad, and that’s

  • 0

XCode has the ability to capture Opengl ES frames from the iPad, and that’s great! I would like to extend this functionality and capture an entire Opengl ES movie of my application. Is there a way for that?
if it’s not possible using XCode, how can i do it without much effort and big changes on my code? thank you very much!

  • 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-13T16:59:59+00:00Added an answer on June 13, 2026 at 4:59 pm

    I use a very simple technique, which requires just a few lines of code.

    You can capture each OGL frame into UIImage using this code:

    - (UIImage*)captureScreen {
    
        NSInteger dataLength = framebufferWidth * framebufferHeight * 4;
    
        // Allocate array.
        GLuint *buffer = (GLuint *) malloc(dataLength);
        GLuint *resultsBuffer = (GLuint *)malloc(dataLength);
        // Read data
        glReadPixels(0, 0, framebufferWidth, framebufferHeight, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
    
        // Flip vertical
        for(int y = 0; y < framebufferHeight; y++) {
            for(int x = 0; x < framebufferWidth; x++) {
                resultsBuffer[x + y * framebufferWidth] = buffer[x + (framebufferHeight - 1 - y) * framebufferWidth];
            }
        }
    
        free(buffer);
    
        // make data provider with data.
        CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, resultsBuffer, dataLength, releaseScreenshotData);
    
        // prep the ingredients
        const int bitsPerComponent = 8;
        const int bitsPerPixel = 4 * bitsPerComponent;
        const int bytesPerRow = 4 * framebufferWidth;
        CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB();
        CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault;
        CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault;
    
        // make the cgimage
        CGImageRef imageRef = CGImageCreate(framebufferWidth, framebufferHeight, bitsPerComponent, bitsPerPixel, bytesPerRow, colorSpaceRef, bitmapInfo, provider, NULL, NO, renderingIntent);
        CGColorSpaceRelease(colorSpaceRef);
        CGDataProviderRelease(provider);
    
        // then make the UIImage from that
        UIImage *image = [UIImage imageWithCGImage:imageRef];
        CGImageRelease(imageRef);
    
        return image;
    }
    

    Then you will capture each frame in your main loop:

    - (void)onTimer {
    
        // Compute and render new frame
        [self update];
    
        // Recording
        if (recordingMode == RecordingModeMovie) {
    
            recordingFrameNum++;
    
            // Save frame
            UIImage *image = [self captureScreen];
            NSString *fileName = [NSString stringWithFormat:@"%d.jpg", (int)recordingFrameNum];
            [UIImageJPEGRepresentation(image, 1.0) writeToFile:[basePath stringByAppendingPathComponent:fileName] atomically:NO];
        }
    }
    

    At the end you will have tons of JPEG files which can be easily converted into a movie by
    Time Lapse Assembler

    If you want to have nice 30FPS movie, hard fix your calc steps to 1 / 30.0 sec per frame.

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

Sidebar

Related Questions

This is not an actual Xcode error message, it is a warning that has
How would one implement a custom auto-complete pop-up menu like Xcode has? At the
Xcode has a nice feature that let you submit your application to iTunes connect
I'm looking to find information on how to update my XCode program that has
This has been annoying me for a while in several XCode projects. I really
I am relatively new to Xcode and one thing that has bothered me is
I have an application in XCode using the sqlite/coredata database and that has already
XCode has been acting really, really strange recently. It is telling me that various
Xcode 4 has a very nice built-in help/documentation that you can access e.g. by
I have an iPhone application in the store that has in-app purchases. This app

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.