Guest User

Untitled

a guest
May 26th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.21 KB | None | 0 0
  1. //
  2. //  GLViewController.m
  3. //  Game Engine Testing
  4. //
  5. //  Created by Isaac Ravindran on 17/1/12.
  6. //  Copyright 2012 ashiswin@gmail.com. All rights reserved.
  7. //
  8.  
  9. #import "GLViewController.h"
  10.  
  11. @implementation GLViewController
  12.  
  13. - (id)init
  14. {
  15.     self = [super init];
  16.     if (self) {
  17.         // Initialization code here.
  18.     }
  19.    
  20.     return self;
  21. }
  22.  
  23. - (void)createOpenGLView
  24. {
  25.     NSOpenGLPixelFormatAttribute pixelFormatAttributes[] =
  26.     {
  27.         NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core,
  28.         NSOpenGLPFAColorSize    , 24                           ,
  29.         NSOpenGLPFAAlphaSize    , 8                            ,
  30.         NSOpenGLPFADoubleBuffer ,
  31.         NSOpenGLPFAAccelerated  ,
  32.         NSOpenGLPFANoRecovery   ,
  33.         0
  34.     };
  35.     NSOpenGLPixelFormat *pixelFormat = [[[NSOpenGLPixelFormat alloc] initWithAttributes:pixelFormatAttributes] autorelease];
  36.     [self setView:[[[NSOpenGLView alloc] initWithFrame:[[[self window] contentView] bounds] pixelFormat:pixelFormat] autorelease]];
  37.     [[[self window] contentView] addSubview:[self view]];
  38. }
  39.  
  40.  
  41. - (void)awakeFromNib
  42. {
  43.     [self createOpenGLView];
  44.     //[self createOpenGLResources];
  45.     //[self createDisplayLink];
  46. }
  47. @end
Add Comment
Please, Sign In to add comment