Fix for antialiasing and VSync not being enabled properly.

master
Geenz 2013-02-25 15:35:21 -05:00
parent 7ea8d2f6c0
commit e19db56688
5 changed files with 16 additions and 6 deletions

View File

@ -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

View File

@ -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]];

View File

@ -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);

View File

@ -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;
}

View File

@ -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;