• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Initialize the OpenGL framework
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initialize the OpenGL framework


  • Subject: Re: Initialize the OpenGL framework
  • From: Patrick Hartling <email@hidden>
  • Date: Thu, 22 Feb 2007 11:24:22 -0600

I did not know that gluNewQuadric() could only be called when there was an
active OpenGL context. I wonder why that hasn't been a problem on any of the
other platforms where this software runs (Windows, IRIX, Linux, FreeBSD, and
Solaris). Fortunately, it should not be a big deal for me to move the
gluNewQuadric() calls. Thanks for the tip.

 -Patrick

Nick Briggs wrote:
> Patrick
>
> before calling any gl API's you must have a valid opengl context set,
> this is happening when you call [NSOpenGLView defaultPixelFormat]
>
> cheers
>
> Nick
>
>
>
> On 22 Feb 2007, at 12:30, email@hidden wrote:
>
>>
>> Message: 1
>> Date: Wed, 21 Feb 2007 20:14:08 -0600
>> From: Patrick Hartling <email@hidden>
>> Subject: Initialize the OpenGL framework
>> To: Cocoa List <email@hidden>
>> Message-ID: <email@hidden>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> I am porting a multi-threaded application development library to
>> Cocoa, and
>> I have run into a problem with what seems to be OpenGL initialization. As
>> far as I can tell, gluNewQuadric() cannot be called in a thread
>> (primordial
>> or otherwise) until after something happens inside the OpenGL
>> framework. For
>> example, the following program crashes:
>>
>> #import <OpenGL/glu.h>
>>
>> int main()
>> {
>>    gluNewQuadric();
>>    return 0;
>> }
>>
>> This one does not:
>>
>> #import <AppKit/NSOpenGLView.h>
>> #import <OpenGL/glu.h>
>>
>> int main()
>> {
>>    [NSOpenGLView defaultPixelFormat];
>>    gluNewQuadric();
>>    return 0;
>> }
>>
>> Is there some more direct mechanism that I can use to do whatever is
>> happening as a side effect of calling +defaultPixelFormat?
>>
>> Thanks in advance.
>>
>>  -Patrick
>
> nick briggs
> director
> pilot ltd
> email@hidden
> 01273 773189
> 07737 454920
>
>
>


--
Patrick L. Hartling                    | VP Engineering, Infiscape Corp.
PGP: http://tinyurl.com/2oum9          | http://www.infiscape.com/

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Re: Cocoa-dev Digest, Vol 4, Issue 176 (From: Nick Briggs <email@hidden>)

  • Prev by Date: Re: Must remove submenu when dealloccing NSMenuItem?
  • Next by Date: Re: Core Data OpenGL
  • Previous by thread: Re: Cocoa-dev Digest, Vol 4, Issue 176
  • Next by thread: Key value observer set up in IB not removed
  • Index(es):
    • Date
    • Thread