@@ -31,8 +31,9 @@ impl GlfwContext {
3131 }
3232
3333 #[ cfg( target_os = "macos" ) ]
34- pub fn create_surface ( & self , width : u32 , height : u32 , scale_factor : f32 ) -> Result < Entity > {
34+ pub fn create_surface ( & self , width : u32 , height : u32 ) -> Result < Entity > {
3535 use processing:: prelude:: surface_create_macos;
36+ let ( scale_factor, _) = self . window . get_content_scale ( ) ;
3637 surface_create_macos (
3738 self . window . get_cocoa_window ( ) as u64 ,
3839 width,
@@ -42,8 +43,9 @@ impl GlfwContext {
4243 }
4344
4445 #[ cfg( target_os = "windows" ) ]
45- pub fn create_surface ( & self , width : u32 , height : u32 , scale_factor : f32 ) -> Result < Entity > {
46+ pub fn create_surface ( & self , width : u32 , height : u32 ) -> Result < Entity > {
4647 use processing:: prelude:: surface_create_windows;
48+ let ( scale_factor, _) = self . window . get_content_scale ( ) ;
4749 surface_create_windows (
4850 self . window . get_win32_window ( ) as u64 ,
4951 width,
@@ -53,8 +55,9 @@ impl GlfwContext {
5355 }
5456
5557 #[ cfg( all( target_os = "linux" , feature = "wayland" ) ) ]
56- pub fn create_surface ( & self , width : u32 , height : u32 , scale_factor : f32 ) -> Result < Entity > {
58+ pub fn create_surface ( & self , width : u32 , height : u32 ) -> Result < Entity > {
5759 use processing:: prelude:: surface_create_wayland;
60+ let ( scale_factor, _) = self . window . get_content_scale ( ) ;
5861 surface_create_wayland (
5962 self . window . get_wayland_window ( ) as u64 ,
6063 self . glfw . get_wayland_display ( ) as u64 ,
@@ -65,8 +68,9 @@ impl GlfwContext {
6568 }
6669
6770 #[ cfg( all( target_os = "linux" , feature = "x11" ) ) ]
68- pub fn create_surface ( & self , width : u32 , height : u32 , scale_factor : f32 ) -> Result < Entity > {
71+ pub fn create_surface ( & self , width : u32 , height : u32 ) -> Result < Entity > {
6972 use processing:: prelude:: surface_create_x11;
73+ let ( scale_factor, _) = self . window . get_content_scale ( ) ;
7074 surface_create_x11 (
7175 self . window . get_x11_window ( ) as u64 ,
7276 self . glfw . get_x11_display ( ) as u64 ,
0 commit comments