mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-03 03:01:22 +00:00
Merge pull request #17 from QB64Team/detect-retina-macos
Detects Retina displays on macOS for proper scaling.
This commit is contained in:
commit
95664863be
|
@ -525,7 +525,18 @@ void sub__glrender(int32 method){
|
|||
|
||||
|
||||
if (render_state.dest_handle==0){
|
||||
static int32 dst_w,dst_h;
|
||||
static int32 dst_w,dst_h;
|
||||
static int32 scale_factor=0;
|
||||
|
||||
#ifdef QB64_MACOSX
|
||||
if (scale_factor==0) {
|
||||
scale_factor=1;
|
||||
if (system("system_profiler SPDisplaysDataType | grep Retina")==0) scale_factor=2;
|
||||
}
|
||||
#else
|
||||
scale_factor=1;
|
||||
#endif
|
||||
|
||||
dst_w=environment__window_width;
|
||||
dst_h=environment__window_height;
|
||||
|
||||
|
@ -539,7 +550,7 @@ void sub__glrender(int32 method){
|
|||
glLoadIdentity();
|
||||
glScalef(1, -1, 1);//flip vertically
|
||||
glTranslatef(0, -dst_h, 0);//move to new vertical position
|
||||
glViewport(0,0,dst_w,dst_h);
|
||||
glViewport(0,0,dst_w * scale_factor,dst_h * scale_factor);
|
||||
|
||||
|
||||
}else{
|
||||
|
|
Loading…
Reference in a new issue