[fltk/fltk] HiDpi issue on macOS with retina display (#279)

GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

[fltk/fltk] HiDpi issue on macOS with retina display (#279) lencil 09:11 Oct 08 top right image
 

with FLTK 1.4

consider followed code.

#include <FL/Fl.H>
#include <FL/Fl_Gl_Window.H>

int main() {
    Fl::use_high_res_GL(1);
    // auto win = new Fl_Gl_Window(400, 300);
    auto win = new Fl_Gl_Window(0, 0, 400, 300, "title");
    win->end();
    win->show();
    // win->make_current();
    printf("%f\n", Fl::screen_scale(win->screen_num()));
    printf("%f\n", win->pixels_per_unit());
    printf("%d\n", win->pixel_w());
    printf("%d\n", win->pixel_h());
    return Fl::run();
}

if use Fl_Gl_Window(x, y, w, h, title);
pixels_per_unit() return 1 on macOS with retina display.
pixel_w() and pixel_h() not retina size.
but in windows it works fine.

if use new Fl_Gl_Window(w, h), pixels_per_unit() return 2.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Direct Link to Message ]
 
bottom left image   bottom right image
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2021 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.