Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // GLViewController.m
- // Game Engine Testing
- //
- // Created by Isaac Ravindran on 17/1/12.
- // Copyright 2012 ashiswin@gmail.com. All rights reserved.
- //
- #import "GLViewController.h"
- @implementation GLViewController
- - (id)init
- {
- self = [super init];
- if (self) {
- // Initialization code here.
- }
- return self;
- }
- - (void)createOpenGLView
- {
- NSOpenGLPixelFormatAttribute pixelFormatAttributes[] =
- {
- NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
- NSOpenGLPFAColorSize , 24 ,
- NSOpenGLPFAAlphaSize , 8 ,
- NSOpenGLPFADoubleBuffer ,
- NSOpenGLPFAAccelerated ,
- NSOpenGLPFANoRecovery ,
- 0
- };
- NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes] autorelease];
- [self setView:[[[NSOpenGLView alloc] initWithFrame:[[[self window] contentView] bounds] pixelFormat:pixelFormat] autorelease]];
- [[[self window] contentView] addSubview:[self view]];
- }
- - (void)awakeFromNib
- {
- [self createOpenGLView];
- //[self createOpenGLResources];
- //[self createDisplayLink];
- }
- @end
Add Comment
Please, Sign In to add comment