Using NSOpenGLView in Cocoa Programming in Mac
By: Aaron Hillegass
NSOpenGLView is an NSView subclass that has an OpenGL drawing context. Just as you needed the focus locked on a view to do drawing with Quartz, so the OpenGL drawing context must be active for any OpenGL drawing commands to have an effect.
Here are some important methods in NSOpenGLView:
- (id)initWithFrame:(NSRect)frameRect pixelFormat:(NSOpenGLPixelFormat *)formatThe designated initializer.
- (NSOpenGLContext*)openGLContextReturns the view's OpenGL context.
- (void)reshapeCalled when the view is resized. The OpenGL context is active when this method is called.
- (void)drawRect:(NSRect)rCalled when the view needs to be redrawn. The OpenGL context is active when this method is called.
Archived Comments
Comment on this tutorial
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
Related Tutorials
Listing of files in a tar file in Mac OS X.
Listing of files in a zip file in Mac OS X.
Multithreading versus Multiprocessing in Mac OS X.
Using NSOpenGLView in Cocoa Programming in Mac
Garbage Collector in Cocoa Programming in Mac
Weak References in Mac Cocoa Programming
Web Services in Mac Cocoa Programming
Printing in Mac Cocoa Programming
What is Cocoa? A brief history of Cocoa.
Programming Language used in Cocoa Programming
Objects, Classes, Methods, and Messages in Cocoa Programming