이 질문이 사소하거나 넌센스 인 경우 미리 사과드립니다 ... 이것은 내가 개발중인 첫 번째 앱 중 하나입니다. (Unfortunatley) 저는 개발자가 아닙니다.OpenGL 3.2 코어가있는 NSOpenGLView
NSOpenGLView
의 하위 클래스 인 사용자 지정보기가 포함 된 NSWindow가 있습니다. NSWindow
과 NSOpenGLView
이후
이 인터페이스 빌더를 통해 생성, 나는 init
도 NSOpenGLContext
도 NSOpenGLPixelFormat
할 필요가 없습니다.
저는 최근에 OS X Lion으로 전환했으며 새로운 OpenGL 3.2를 활용하려고합니다. NSOpenGLContext
을 초기화하기 전에
NSOpenGLPixelFormatAttribute pixelFormatAttributes[] =
{
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
0
};
NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes] autorelease];
NSOpenGLContext* openGLContext = [[[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil] autorelease];
: 애플의 문서에서
나는 OpenGL을 3.2 단순히 뭔가를 쓸 필요가 가능하도록 것을 알아 냈다.이것은 (내게조차도) 꽤 쉽지만, 결코 내 앱에서 이것을 구현할 수 있습니까? init
NSOpenGLContext
?
NSOpenGLView
은 Interface Builder에서 작성되었으므로 -initWithFormat:shareContext:
메서드는 호출되지 않습니다.
-(id)initWithCoder:(NSCoder *)aDecoder
{
NSOpenGLPixelFormatAttribute pixelFormatAttributes[] =
{
NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
0
};
NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes] autorelease];
NSOpenGLContext* openGLContext = [[[NSOpenGLContext alloc] initWithFormat:pixelFormat shareContext:nil] autorelease];
[super initWithCoder:aDecoder];
[self setOpenGLContext:openGLContext];
[openGLContext makeCurrentContext];
}
및 glGetString(GL_VERSION)
으로보고 있지만, 생성 된 컨텍스트가 더 이상 응용 프로그램과 상호 작용으로는 OpenGL 3.2를 제대로 넣었는 ... 아무것도 없다 :
-initWithCoder:
메소드를 오버라이드 (override) 시도 보기에서 그려진.
내가 아는 모든 것을 시도했지만 ... 나는 이것을 해결할 수 없다.
대신 어떻게해야합니까?