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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:56:09+00:00 2026-05-29T03:56:09+00:00

I am creating a Cocoa OpenGL game in Xcode, which I wish to at

  • 0

I am creating a Cocoa OpenGL game in Xcode, which I wish to at some point distribute on the Mac App store. I’m unsure what to do when my application encounters a fatal error, namely being unable to create a pixel format or OpenGL context. I think I should display some message saying what happened, perhaps giving the user a form to enter a quick comment and have it sent to me (how would I do this?), and then terminate. But what would be the best way to do this?

…

NSOpenGLPixelFormatAttribute attribs[] = {
    …
    NSOpenGLPFAAccelerated,           // Hardware acceleration
    NSOpenGLPFADoubleBuffer,          // Double buffering
    NSOpenGLPFAColorSize, 320,        // *** THIS IS FOR TESTING FAILURE ***
    0
};

// Create pixel format
pixelFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];
if (!pixelFormat) {
    //////////////////////////////FATAL ERROR//////////////////////////////
}

// Create OpenGL context
openGLContext = [[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil];
if (!openGLContext) {
    //////////////////////////////FATAL ERROR//////////////////////////////
}

…

Notice I’ve requested a color size of 320 simply to test what will happen in this unlikely case.

I’ve looked into NSAlert but it seems to be more suited for warning messages, even when the style is set to NSCriticalAlertStyle. And I think afterwards I should quit with [NSApp terminate:nil] but I’m unsure. What should I do in these cases, to be consistent other apps and to conform to the Apple way of doing such a thing?

Note that this only happens on startup.

  • 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-29T03:56:11+00:00Added an answer on May 29, 2026 at 3:56 am

    I don’t think you should ask the user for info. You should probably write state to disk and then offer to send the crash report on next startup. Your data should record what the user’s last N actions were, etc. Asking the user for info is irritating to the user, and probably won’t give you the real info you need.

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

Sidebar

Related Questions

I am creating application for MAC using cocoa framework, I would like to know
I'm creating a Cocoa Mac OS X app to install printers using a NSTask
I am creating NSButton dynamically in the cocoa application which is fine. However once
I'm creating a mainly GUI Cocoa app, but I want to create a command
How do I go about programmatically creating audio streams using Cocoa on the Mac.
I'm creating a backgrounded cocoa application. The only thing that it's missing is the
We are creating an ios app, In which we want to use certain interactive
I have some processing in my Cocoa app that sometimes ends up calling through
I'm creating a shareware Cocoa app and I wanted to know what is the
I am creating a Cocoa application wherein one view will contain the hex dump

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.