Programming Tutorials

(追記) (追記ここまで)

Using NSOpenGLView in Cocoa Programming in Mac

By: Aaron Hillegass in Cocoa Tutorials on 2010年09月24日 [フレーム]

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 *)format

The designated initializer.

- (NSOpenGLContext*)openGLContext

Returns the view's OpenGL context.

- (void)reshape

Called when the view is resized. The OpenGL context is active when this method is called.

- (void)drawRect:(NSRect)r

Called when the view needs to be redrawn. The OpenGL context is active when this method is called.




(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /