summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-12-02 14:22:52 +0000
committerManolo Gouy <Manolo>2015-12-02 14:22:52 +0000
commit58afd21c7312c1d9225bded5fc1b6549b331b707 (patch)
tree10149d064f7fe0b1b46cf41419ce27febc747447 /src
parent8a826c257ddd39a429cc54e50792c8968ed14989 (diff)
Mac OS: send the setWantsBestResolutionOpenGLSurface:YES message in
Fl_X::create_GLcontext_for_window() where it is directly relevant. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10947 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 02b8e7ce1..f29e96e67 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2824,7 +2824,16 @@ NSOpenGLContext* Fl_X::create_GLcontext_for_window(NSOpenGLPixelFormat *pixelfor
NSOpenGLContext *shared_ctx, Fl_Window *window)
{
NSOpenGLContext *context = [[NSOpenGLContext alloc] initWithFormat:pixelformat shareContext:shared_ctx];
- if (context) [context setView:[fl_xid(window) contentView]];
+ if (context) {
+ NSView *view = [fl_xid(window) contentView];
+ if (fl_mac_os_version >= 100700 && Fl::use_high_res_GL()) {
+ //replaces [view setWantsBestResolutionOpenGLSurface:YES] without compiler warning
+ typedef void (*bestResolutionIMP)(id, SEL, BOOL);
+ static bestResolutionIMP addr = (bestResolutionIMP)[NSView instanceMethodForSelector:@selector(setWantsBestResolutionOpenGLSurface:)];
+ addr(view, @selector(setWantsBestResolutionOpenGLSurface:), YES);
+ }
+ [context setView:view];
+ }
return context;
}
@@ -3031,12 +3040,6 @@ void Fl_X::make(Fl_Window* w)
Fl_X::first = x;
}
FLView *myview = [[FLView alloc] initWithFrame:crect];
- if (w->as_gl_window() && fl_mac_os_version >= 100700 && Fl::use_high_res_GL()) {
- //replaces [myview setWantsBestResolutionOpenGLSurface:YES] without compiler warning
- typedef void (*bestResolutionIMP)(id, SEL, BOOL);
- static bestResolutionIMP addr = (bestResolutionIMP)[NSView instanceMethodForSelector:@selector(setWantsBestResolutionOpenGLSurface:)];
- addr(myview, @selector(setWantsBestResolutionOpenGLSurface:), YES);
- }
[cw setContentView:myview];
[myview release];
[cw setLevel:winlevel];