[Fuse-for-macosx-commits] SF.net SVN: fuse-for-macosx:[614] branches/fuse_corevideo/fuse/fusepb/vie
Brought to you by:
fredm
From: <fr...@us...> - 2009-08-08 13:41:54
|
Revision: 614 http://fuse-for-macosx.svn.sourceforge.net/fuse-for-macosx/?rev=614&view=rev Author: fredm Date: 2009-08-08 13:41:47 +0000 (Sat, 08 Aug 2009) Log Message: ----------- Extract OpenGL initialisation. Modified Paths: -------------- branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.h branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.m Modified: branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.h =================================================================== --- branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.h 2009-08-02 12:11:55 UTC (rev 613) +++ branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.h 2009-08-08 13:41:47 UTC (rev 614) @@ -88,6 +88,7 @@ -(void) createTexture:(Cocoa_Texture*)newScreen; -(void) destroyTexture; -(void) blitIcon:(Texture*)iconTexture; +-(void) prepareOpenGL:(NSOpenGLContext *)context; -(void) setServer:(id)anObject; -(id) initWithFrame:(NSRect)frameRect; Modified: branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.m =================================================================== --- branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.m 2009-08-02 12:11:55 UTC (rev 613) +++ branches/fuse_corevideo/fuse/fusepb/views/DisplayOpenGLView.m 2009-08-08 13:41:47 UTC (rev 614) @@ -203,11 +203,7 @@ [[self openGLContext] makeCurrentContext]; - /* Setup some basic OpenGL stuff */ - glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); - glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); - glClearColor(0.0f, 0.0f, 0.0f, 0.0f); - glColor4f(0.0f, 0.0f, 0.0f, 0.0f); + [self prepareOpenGL:[self openGLContext]]; greenCassette = [Texture alloc]; redCassette = [Texture alloc]; @@ -269,6 +265,20 @@ [super dealloc]; } +- (void) prepareOpenGL: (NSOpenGLContext *) context; +{ + long swapInt = 1; + + /* set to vbl sync */ + [context setValues:&swapInt forParameter:NSOpenGLCPSwapInterval]; + + /* Setup some basic OpenGL stuff */ + glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); + glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); + glColor4f(0.0f, 0.0f, 0.0f, 0.0f); +} + -(void) awakeFromNib { /* keep the window in the standard aspect ratio if the user resizes */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |