• 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: Can't get OpenGL to work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can't get OpenGL to work


  • Subject: Re: Can't get OpenGL to work
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Sun, 24 Mar 2002 23:25:51 +0100

Le dimanche 24 mars 2002, ` 10:41 , Drew Cunningham a icrit :

It seemed like simple code, but I can't get this OpenGL code to show anything. Am I missing something? I've set the custom view as a MyOpenGLView, and here is the code for it:
(...)
- (void)drawRect:(NSRect)rect
{
[[self openGLContext] makeCurrentContext];

// Basic drawing routine. Override of drawRect function
(...)

// Update the GL context
[[self openGLContext] flushBuffer];

}
I don't know for sure in your case, but you should use glFinish ();
instead of the call to flushBuffer. Also you don't need makeCurrentContext,
it is already done when drawRect is called (by lockFocus I suspect).

If that still doesn't work, there are a lot of working examples on the net,
including at Apple, that you can use and modify to your needs. See for instance
http://developer.apple.com/samplecode/Sample_Code/Graphics_3D.htm


Thomas Lachand-Robert
********************** email@hidden
<< Et le chemin est long du projet ` la chose. >> Molihre, Tartuffe.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Can't get OpenGL to work (From: Drew Cunningham <email@hidden>)

  • Prev by Date: Re: cocoa-dev digest, Vol 2 #385 - 14 msgs
  • Next by Date: ANNOUNCE: GNUMail.app 1.0.0
  • Previous by thread: Can't get OpenGL to work
  • Next by thread: document types
  • Index(es):
    • Date
    • Thread