Fix for antialiasing and VSync not being enabled properly.
parent
7ea8d2f6c0
commit
e19db56688
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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]];
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue