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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:21:39+00:00 2026-05-28T08:21:39+00:00

I am trying to set up an OpenGL 3.0+ context within XCode 4. As

  • 0

I am trying to set up an OpenGL 3.0+ context within XCode 4.

As you can see talking about shaders here at the developer website the example it uses is OpenGL 2.0. In Appendix B it does talk about updating for 3.2 but just shows you function name changes and what only applies to the core, yet there is no example of actually setting up an OpenGL context. This has changed greatly since the fixed function pipeline being that you can no longer do things like glMatrixMode(…).. etc etc…i.e. opengl states are no longer.

If anyone can point me to a link somewhere on the web of setting up an OpenGL 3.0+ context on Mac OSX 10.7 using XCode 4 it would be appreciated.

  • 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-28T08:21:40+00:00Added an answer on May 28, 2026 at 8:21 am

    There is some example code here for setting up an 3.2 context inside an NSOpenGLView.

    Or using Core GL,

    CGLPixelFormatAttribute attribs[13] = {
        kCGLPFAOpenGLProfile, (CGLPixelFormatAttribute)kCGLOGLPVersion_3_2_Core, // This sets the context to 3.2
        kCGLPFAColorSize,     (CGLPixelFormatAttribute)24,
        kCGLPFAAlphaSize,     (CGLPixelFormatAttribute)8,
        kCGLPFAAccelerated,
        kCGLPFADoubleBuffer,
        kCGLPFASampleBuffers, (CGLPixelFormatAttribute)1,
        kCGLPFASamples,       (CGLPixelFormatAttribute)4,
        (CGLPixelFormatAttribute)0
    };
    
    CGLPixelFormatObj pix;
    GLint npix;
    CGLChoosePixelFormat(attribs, &pix, &npix);
    
    CGLContextObj ctx;
    CGLCreateContext(pix, 0, &ctx);
    
    CGLSetCurrentContext(ctx);
    CGLLockContext(ctx);
    

    In either case you have to do it manually(not through InterfaceBuilder) because it’s opt-in.

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

Sidebar

Related Questions

I'm trying to set up an OpenGL context with sfml2. Everthing worked fine and
Im trying to create a spinning square inside of xcode using opengl but instead
I'm creating a game engine using wxWidgets and OpenGL. I'm trying to set up
I was trying to set point sprites in OpenGL to change size with distance
I'm trying to visualize Mandelbrot set with OpenGL and have found very strange behaviour
I'm following these docs and trying to set OpenGL version to 1.1. But when
Im trying set the single table inheritance model type in a form. So i
I am trying set up databinding as described in the title. The problem I
Trying to set up caching on our datasets - we're using clr stored procedures
Trying to set it so if a certain condition is met then one of

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.