diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llwindow/llopenglview-objc.h | 3 | ||||
-rw-r--r-- | indra/llwindow/llopenglview-objc.mm | 11 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx-objc.h | 2 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx-objc.mm | 4 | ||||
-rw-r--r-- | indra/llwindow/llwindowmacosx.cpp | 2 |
5 files changed, 16 insertions, 6 deletions
diff --git a/indra/llwindow/llopenglview-objc.h b/indra/llwindow/llopenglview-objc.h index cc1618b3bc..b344bed2ef 100644 --- a/indra/llwindow/llopenglview-objc.h +++ b/indra/llwindow/llopenglview-objc.h @@ -16,7 +16,8 @@ { std::string mLastDraggedUrl; } - +- (id) initWithSamples:(NSUInteger)samples; +- (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync; - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync; // rebuildContext diff --git a/indra/llwindow/llopenglview-objc.mm b/indra/llwindow/llopenglview-objc.mm index 3a6225eab5..e89c9267d5 100644 --- a/indra/llwindow/llopenglview-objc.mm +++ b/indra/llwindow/llopenglview-objc.mm @@ -61,10 +61,19 @@ - (id) init { - //[self registerForDraggedTypes:[NSArray arrayWithObjects:NSURLPboardType, NSFilenamesPboardType, nil]]; return [self initWithFrame:[self bounds] withSamples:2 andVsync:TRUE]; } +- (id) initWithSamples:(NSUInteger)samples +{ + return [self initWithFrame:[self bounds] withSamples:samples andVsync:TRUE]; +} + +- (id) initWithSamples:(NSUInteger)samples andVsync:(BOOL)vsync +{ + return [self initWithFrame:[self bounds] withSamples:samples andVsync:vsync]; +} + - (id) initWithFrame:(NSRect)frame withSamples:(NSUInteger)samples andVsync:(BOOL)vsync { [self registerForDraggedTypes:[NSArray arrayWithObject:NSURLPboardType]]; diff --git a/indra/llwindow/llwindowmacosx-objc.h b/indra/llwindow/llwindowmacosx-objc.h index 32d1a4d9a2..a0eab61e7c 100644 --- a/indra/llwindow/llwindowmacosx-objc.h +++ b/indra/llwindow/llwindowmacosx-objc.h @@ -59,7 +59,7 @@ void hideNSCursorTillMove(bool hide); NSWindowRef createNSWindow(int x, int y, int width, int height); #include <OpenGL/OpenGL.h> -GLViewRef createOpenGLView(NSWindowRef window); +GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync); void glSwapBuffers(void* context); CGLContextObj getCGLContextObj(GLViewRef view); void getContentViewBounds(NSWindowRef window, float* bounds); diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index b123ba0711..b288671219 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -214,9 +214,9 @@ NSWindowRef createNSWindow(int x, int y, int width, int height) return window; } -GLViewRef createOpenGLView(NSWindowRef window) +GLViewRef createOpenGLView(NSWindowRef window, unsigned int samples, bool vsync) { - LLOpenGLView *glview = [[LLOpenGLView alloc]initWithFrame:[(LLNSWindow*)window frame] withSamples:0 andVsync:FALSE]; + LLOpenGLView *glview = [[LLOpenGLView alloc]initWithFrame:[(LLNSWindow*)window frame] withSamples:samples andVsync:vsync]; [(LLNSWindow*)window setContentView:glview]; return glview; } diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp index 9ce19bd977..ac0fa54a68 100644 --- a/indra/llwindow/llwindowmacosx.cpp +++ b/indra/llwindow/llwindowmacosx.cpp @@ -404,7 +404,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits LL_INFOS("Window") << "Creating GL view..." << LL_ENDL; // Our OpenGL view is already defined within SecondLife.xib. // Get the view instead. - mGLView = createOpenGLView(mWindow); + mGLView = createOpenGLView(mWindow, mFSAASamples, !disable_vsync); mContext = getCGLContextObj(mGLView); // Since we just created the context, it needs to be set up. glNeedsInit = TRUE; |