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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:08:34+00:00 2026-05-16T01:08:34+00:00

I am trying to check that my NSOpenGLView has a valid context but it

  • 0

I am trying to check that my NSOpenGLView has a valid context but it seems that a call to openGLContext will not help me figure this out. openGLContext seems to always returns a an NsOpenGlContext (it returns the current context if the view has one and if not it makes a context and returns that). Is there another method I could use instead?

  • 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-16T01:08:35+00:00Added an answer on May 16, 2026 at 1:08 am

    OpenGL contexts are selected per-thread. NSOpenGLView will tell you which context should be used to draw in the view (ie. which one has had [context setView: view] called on), but not which context is currently selected in the thread that’s executing the code. It’s a bit like selecting pen/brush to draw with in old Windows.

    I understand that you want to know if you can draw in view. To do that, check if current context is the one that NSOpenGLView returns, and if not, set it to be.

    To get current OpenGL context for the thread:

    NSOpenGLContext* context = [NSOpenGLContext currentContext];
    

    To set one as current:

    [context makeCurrentContext];
    

    To clear current context (ie. set no current context):

    [NSOpenGLContext clearCurrentContext];
    

    In general, see docs for NSOpenGLContext.

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

Sidebar

Related Questions

I'm trying to develop a bit of VBA that will check the date modified
I'm trying to make a PHP script that will check the HTTP status of
I am trying to make a bookmarklet that when clicked will check the URL
I'm trying to figure out how I'd add a contains to check that the
I'm simply trying to check that one of the three radio boxes has been
Is it possible to check that an object is in the context before trying
I'm trying to check that user's submitted data, from $_POST , has at least
How do you check that data.results in the following is not empty before trying
I am trying to check that my function returns Some(x) testedFunc() |> should be
So basically I am trying to check the arguments that are passed into the

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.