macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

setOpenGLContext:

NSOpenGLContextをセットします
-(void)setOpenGLContext:(NSOpenGLContext*)context:

解説

NSOpenGLContextをセットします。

返り値

( void )

なし

引数

( NSOpenGLContext* )context

フレームワーク

ApplicationKit

クラス

NSOpenGLView

Instance Methods

使用可能

10.0

参照

- clearGLContext
- openGLContext

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSOpenGLContext *glContext =[NSOpenGLContext currentContext];
NSOpenGLContext *glContext2;
NSOpenGLView* glView = [[NSOpenGLView alloc] initWithFrame:NSMakeRect(0,0,100,100)
pixelFormat:[NSOpenGLView defaultPixelFormat]];
[glView setOpenGLContext:glContext];


glContext2 = [glView openGLContext];

NSLog([glContext2 description]);
}

@end