Comments (28)
@SoloByte I'm reopening to continue the discussion but feel free to open separate issues for related problems.
from raylib.
@SuperUserNameMan can confirm that disabling resizable flag before entering fullscreen helps & can´t test it on macOS because I am not set up for raylib development.
@raysan5 should I open new issues for the other problems I have found mention above?
from raylib.
@SuperUserNameMan @fishbowlforever
I am currently investigating the fullscreen & borderless fullscreen issues.
What I have found is that fullscreen mode sets the window size to the current screen size before entering fullscreen instead of setting it to the monitor size. (Borderless fullscreen sets the window size to the monitor size)
Setting the window size calls the window resized callback and before fix #4143 it would then scale the current window size further down each time fullscreen is exited.
I think this loop may also causes the issue that is still there with the 1/4 of the screen in the topleft.
@raysan5 I will open a new issue for fullscreen / borderless fullscreen mode & 1 issue for the screen/render/monitor size confusion with the dpi scale ?
from raylib.
@SuperUserNameMan I have already tested it and it improves things. The screen size values are correct and no longer missing a few pixels.
from raylib.
@SuperUserNameMan I have not tested it with the new patch
ok then, let's start again from a fresh code base then.
I agree but just for clarification, I have tested it on macOS with the same project as above. The patch you did should not have affected macOS anyway, correct?
correct. because with the patch, all desktop platforms now use the same __APPLE__
code branch in GetWindowScaleDPI()
.
Now, i'm going to read the new issues and conversation you opened.
from raylib.
@fishbowlforever Thanks for reporting, could you reproduce this issue on Windows 10? It sounds like platform dependant...
In any case, I'm afraid I don't have a HighDPI monitor at the moment for testing on my side...
from raylib.
@fishbowlforever Thanks for reporting, could you reproduce this issue on Windows 10? It sounds like platform dependant...
In any case, I'm afraid I don't have a HighDPI monitor at the moment for testing on my side...
set display scaling to 125% enough
from raylib.
MacOS
Edit: I think it might be better to put it in a separate issue? It is kind of related but on macOS. (see 3rd image)
I am experiencing similar issues on macOS as well. I made a simple raylib cs project to test all of the following things.
When in windowed mode the render size is 2x the screen size, which is correct for retina/high dpi screens. (dpi value shows up as 2, 2 as well)
Setting the high dpi config flag has no effect on my system. I have tested it without setting it and with setting it before & after InitWindow.
There are 3 types of fullscreen mode:
- Fullscreen (normal Fullscreen Mode)
- Borderless Fullscreen (behaves like maximize window on macOS)
- MacOS Fullscreen (clicking green button top left corner)
MacOS Fullscreen works almost correctly.
- DPI value is 1, 1 instead of 2, 2 but everything looks correctly. I don’t know if this is correct behavior because the macOS scaling factor for retina/ high dpi is always 2!
- Screen size and render size are the same (dpi factor of 1, 1) but it renders over the entire screen
Borderless fullscreen behaves almost correctly as well.
- Render Size is 2x of the screen size and values are correct for the monitor I am using (dpi factor is 2, 2)
- Window is cut off at the top even though numbers are correct (looks more like a maximized window)
Fullscreen is were things get complicated.
- To have fullscreen mode work at all the window size must be set to the current monitor size before enabling fullscreen.
- DPI value is suddenly 1, 1 instead of 2, 2 like with the macOS fullscreen mode but it looks wrong too.
- It seems to only render a quarter of the screen
- The screen size value is off, it should be the monitor size
- Screen size and render size should be the same with a dpi factor of 1, 1 but screen size value is off (point 4)
Windowed Mode for comparison
The good news is that all the fullscreen modes work & behave the same no matter what resolution I set in the macOS display settings.
I think that the dpi value is the problem. If I have a 4k monitor and display settings resolution set to something other than 4k macOS will always use a dpi value of 2. In windows the scale value can be set directly but in macOS target resolution is set.
For example:
- If I have a 4k monitor and set my target resolution to 2560x1440 macOS upscales the 4k to 5k and than applies the factor of 2 to get to 1440p.
- If I set the target resolution to 1920x1080 it will apply the dpi scale of 2 right away because 1080p is multiple of 4k.
- If I set the target resolution to 4k than no scaling happens (dpi factor is 1) but it is also unusable.
- If you use a 1440p monitor and set target resolution to 1440p it would be a dpi value of 1 and usable.
So for macOS there are only 2 possbile values (as far as I know) for dpi factor and that is 1 or 2.
Similar issues with fullscreen:
- Borderless fullscreen & fullscreen behave differently on macOS vs windows. (Borderless Fullscreen works flawless on windows and is my preferred fullscreen mode on windows, but it is more like maximize window on macOS; Fullscreen almost works on macOS because of the above issue, but on windows it takes a up to 1-2 seconds to apply with flickering and black screens in between)
- Borderless fullscreen remembers the previous window state and applies it correctly when exiting borderless fullscreen but normal fullscreen does not.
from raylib.
If I multiply the monitor size by 2 before entering fullscreen another weird thing happens...
var monitor = GetCurrentMonitor();
SetWindowSize(GetMonitorWidth(monitor) * 2, GetMonitorHeight(monitor) * 2);
ToggleFullscreen();
The monitor size should be 1920x1080 before entering fullscreen (my target resolution on a 4k monitor). If I multiply this by 2 I should get the 4k resolution and if I then set the window size to the 4k resolution and enter fullscreen (were the dpi value is suddenly 1) I expect those value:
- ScreenSize 4k
- RenderSize 4k (because dpi is 1)
- MonitorSize 4k (because dpi is 1)
Why is only width affect and height suddenly not? :)
from raylib.
Windows
I have tested fullscreen & high dpi functionality on windows 11 with a 4k monitor as well. I have set the scaling to 200% in settings. I have also tested everything with the scaling set to 100%. If something is not clear or I did something wrong or missed a step, please feel free to correct me.
Windowed
- Screen Size: 800x800
- Render Size: 800x800
- Monitor Size: 3840x2160
- DPI: 2,2
Maximized
- Screen Size: 3840x2019
- Render Size: 3840x2019
- Monitor Size: 3840x2160
- DPI: 2,2
Borderless Fullscreen
- Screen Size: 3840x2160
- Render Size: 3840x2160
- Monitor Size: 3840x2160
- DPI: 2,2
Fullscreen
- Screen Size: 3840x2119 !!!
- Render Size: 3840x2160
- Monitor Size: 3840x2160
- DPI: 2,2
I have tested everything with a 100% scaling on a 4k monitor as well. Everything works but it reported the exact same values as with a scaling of 200%.
My findings:
- On Windows the dpi value is always correct. No matter the window mode it always reports the scaling set in the settings. On macOS it reports the correct value except in fullscreen mode were it always reports 1, 1.
- On windows the monitor size always reports the native resolution of the monitor independent of the system scaling. On macOS it DOES NOT behave this way. Most of the times it is the monitor resolution divided by the scaling or it something weird in the fullscreen modes.
- On windows & macOS the high dpi config flag had no impact on anything as far as I can tell. I have tested it without setting it, with setting it before & after init window, and with clearing it before & after init window. If I did something wrong or missed something please correct me.
- On windows the screen & render size are always the same even if there is dpi scaling. On macOS the render size is always multiplied by the dpi value.
- On windows the size of the window always covers the same area with the same size. Example: On a 4k monitor with scaling of 200% a window of the size 1920x1080 covered 1/4 of the screen. On a 4k monitor with scaling of 100% a window if the size 1920x1080 covered 1/4 of the screen as well. In my opinion that dpi scaling makes sense the a 1920x1080 window should cover the entire screen on a 4k monitor with scaling set to 200%.
Screen Size, Render Size, Monitor Size
The following things are what I understand about screen size, monitor size, and render size. I do not know if I am correct at all. My main goal here is to figure out together what each of this numbers should represent independent of the the operating system.
- Monitor Size should always report the native resolution of the monitor unaffected by any scaling ?
- The dpi value should always report the dpi scaling of the system irregardless of the window mode. (windowed & fullscreen should report the same dpi value)?
- The screen size should be the actual size of the window ? Does this mean it should be in native resolution or in scaled resolution? Should a window covering 1/4 of a 4k monitor with a dpi scale of 2 have a Screen Size of 1920x1080 or 960x540?
- Should the render size always be the screen size x dpi factor? Or should they be the same? (which kinda makes no sense)
To me personally only Example A makes sense. (on all operating systems. I do not know how scaling works on windows but on macOS it can only be 1, 1 or 2, 2. There are other combinations possible as well not just the ones from example A & B but I didn’t want to write them all down ;)
Example A
-
4k monitor
-
Scaling Factor 200%
-
Windowed Mode
- Screen Size 960x540 (covers 1/4 of the screen)
- Render Size 1920x1080
- Monitor Size 3840x2160
- DPI 2, 2
-
Fullscreen Mode
- Screen Size 1920x1080 (covers entire screen because it is fullscreen)
- Render Size 3840x2160
- Monitor Size 3840x2160
- DPI 2, 2
-
-
Scaling Factor 100%
- Windowed Mode
- Screen Size 1920x1080 (covers 1/4 of the screen)
- Render Size 3840x2160
- Monitor Size 3840x2160
- DPI 2, 2
- Fullscreen Mode
- Screen Size 3840x2160 (covers entire screen because it is fullscreen)
- Render Size 3840x2160
- Monitor Size 3840x2160
- DPI 2, 2
- Windowed Mode
Example B
-
4k monitor
-
Scaling Factor 200%
-
Windowed Mode
- Screen Size 1920x1080 (covers 1/4 of the screen)
- Render Size 1920x1080
- Monitor Size 3840x2160
- DPI 2, 2
-
Fullscreen Mode
- Screen Size 3840x2160 (covers entire screen because it is fullscreen)
- Render Size 3840x2160
- Monitor Size 3840x2160
- DPI 2, 2
-
-
Scaling Factor 100%
- Windowed Mode
- Screen Size 1920x1080 (covers 1/4 of the screen)
- Render Size 3840x2160
- Monitor Size 3840x2160
- DPI 2, 2
- Fullscreen Mode
- Screen Size 3840x2160 (covers entire screen because it is fullscreen)
- Render Size 3840x2160
- Monitor Size 3840x2160
- DPI 2, 2
- Windowed Mode
from raylib.
@raysan5 If you need anything else just tell me. As mentioned above I can also put all my comments in a seperate issue. If needed I can also put a zip file here with the minimal project I used to test this (all raylib cs btw).
from raylib.
@SoloByte : could you share a code example ?
I can also put a zip file here with the minimal project I used to test this
Yes please, i'd like to test it too.
from raylib.
@SuperUserNameMan Here you go :) I am very interested in your results :D
Minimal Reproduction Example
- I used raylib cs 6.1.1 (should be easy to rewrite for c raylib)
- tested it both on windows & macOS
minimal-reproduction-raylib-fullscreen.txt
using System.Numerics;
using Raylib_cs;
using static Raylib_cs.Raylib;
using Color = Raylib_cs.Color;
namespace FullscreenTest;
public static class Program
{
public static void Main(string[] args)
{
var bgColor = Raylib.ColorBrightness(Raylib_cs.Color.DarkBlue, -0.5f);
var test = new Test(800, 800, "Test", bgColor, 60);
test.Run();
}
}
public class FullscreenTest
{
private Font fontDefault;
public Color BackgroundColor;
public float DeltaTime { get; private set; } = 0f;
public Vector2 GetScreenSize() => new Vector2(GetScreenWidth(), GetScreenHeight());
public Vector2 GetRenderSize() => new Vector2(GetRenderWidth(), GetRenderHeight());
public Vector2 GetDPI() => GetWindowScaleDPI();
public Vector2 GetMonitorSize()
{
var monitor = GetCurrentMonitor();
return new Vector2(GetMonitorWidth(monitor), GetMonitorHeight(monitor));
}
private int prevFullscreenWidth = 0;
private int prevFullscreenHeight = 0;
private int prevFullscreenX = 0;
private int prevFullscreenY = 0;
public Test(int width, int height, string title, Color backgroundColor, int targetFramerate = 60)
{
Raylib.SetWindowState(ConfigFlags.Msaa4xHint);
Raylib.InitWindow(width, height, title);
Raylib.InitAudioDevice();
Raylib.ClearWindowState(ConfigFlags.VSyncHint);
Raylib.SetTargetFPS(targetFramerate);
Raylib.SetWindowState(ConfigFlags.ResizableWindow);
fontDefault = Raylib.GetFontDefault();
BackgroundColor = backgroundColor;
}
public void Run()
{
StartApplication();
//Main loop
while (!Raylib.WindowShouldClose())
{
//Update
var dt = Raylib.GetFrameTime();
DeltaTime = dt;
Update(dt);
//Drawing
Raylib.BeginDrawing();
Raylib.ClearBackground(BackgroundColor);
Draw();
Raylib.EndDrawing();
}
//End
CloseApplication();
Raylib.CloseAudioDevice();
Raylib.CloseWindow();
}
protected virtual void Update(float dt)
{
//I am not checking if fullscreen is already active when pressing borderless fullscreen and vice versa.
//Fullscreen
if (IsKeyPressed(KeyboardKey.F))
{
if (IsWindowFullscreen())
{
ToggleFullscreen();
SetWindowSize(prevFullscreenWidth, prevFullscreenHeight);
SetWindowPosition(prevFullscreenX, prevFullscreenY);
}
else
{
prevFullscreenWidth = GetScreenWidth();
prevFullscreenHeight = GetScreenHeight();
prevFullscreenX = (int)GetWindowPosition().X;
prevFullscreenY = (int)GetWindowPosition().Y;
var monitor = GetCurrentMonitor();
SetWindowSize(GetMonitorWidth(monitor), GetMonitorHeight(monitor));
ToggleFullscreen();
}
}
//Borderless Fullscreen
else if (IsKeyPressed(KeyboardKey.B))
{
ToggleBorderlessWindowed();
}
}
protected virtual void Draw()
{
var size = GetScreenSize();
var infoRect = new Rectangle(new(), size);
//draw the border of the screen
DrawRectangleLinesEx(infoRect, 4f, Color.Gray);
//draw the text in the center
DrawScreenInformation(infoRect, 50, Color.Lime);
}
protected virtual void StartApplication() { }
protected virtual void CloseApplication() { }
private void DrawScreenInformation(Rectangle rect, int fontSize, Color color)
{
var sw = GetScreenWidth();
var sh = GetScreenHeight();
var rw = GetRenderWidth();
var rh = GetRenderHeight();
var dpi = GetWindowScaleDPI();
var monitor = GetCurrentMonitor();
var mw = GetMonitorWidth(monitor);
var mh = GetMonitorHeight(monitor);
var text1 = $"Screen {sw}x{sh} | Render {rw}x{rh}";
var text2 = $"Monitor {mw}x{mh} | DPI {dpi}";
var textSize1 = MeasureTextEx(fontDefault, text1, fontSize, 1f);
var textSize2 = MeasureTextEx(fontDefault, text2, fontSize, 1f);
var width = rect.Size.X * 0.75f;
if (textSize1.X > textSize2.X)
{
if (textSize1.X > width)
{
var f = width / textSize1.X;
fontSize = (int)(fontSize * f);
textSize1 = MeasureTextEx(fontDefault, text1, fontSize, 1f);
textSize2 = MeasureTextEx(fontDefault, text2, fontSize, 1f);
}
}
else
{
if (textSize2.X > width)
{
var f = width / textSize2.X;
fontSize = (int)(fontSize * f);
textSize1 = MeasureTextEx(fontDefault, text1, fontSize, 1f);
textSize2 = MeasureTextEx(fontDefault, text2, fontSize, 1f);
}
}
var rectCenter = rect.Position + (rect.Size / 2);
var textPos1 = rectCenter - (textSize1 / 2);
var textPos2 = rectCenter - (textSize2 / 2);
DrawText(text1, (int)textPos1.X, (int)textPos1.Y, fontSize, color);
DrawText(text2, (int)textPos2.X, (int)(textPos2.Y + textSize1.Y), fontSize, color);
}
}
from raylib.
OMG ! Yuck ! C# ! I feel like someone barfed into my eyes X-(
I hope this is what you meant :
#include "raylib.h"
void update();
void draw();
int main( int argc , char **argv )
{
SetWindowState( FLAG_MSAA_4X_HINT );
SetConfigFlags( FLAG_WINDOW_HIGHDPI ); // <===== ???
InitWindow( 800 , 800 , "Test" );
ClearWindowState( FLAG_VSYNC_HINT );
SetTargetFPS( 60 );
SetWindowState( FLAG_WINDOW_RESIZABLE );
while( ! WindowShouldClose() )
{
update();
BeginDrawing();
{
ClearBackground( RAYWHITE );
draw();
}
EndDrawing();
}
CloseWindow();
}
void update()
{
// He said he does not check if fullscreen is already active
// when pressing borderless fullscreen and vice versa.
static int prevFullscreenWidth = 0;
static int prevFullscreenHeight = 0;
static int prevFullscreenX = 0;
static int prevFullscreenY = 0;
// Fullscreen :
if ( IsKeyPressed( KEY_F ) )
{
if ( IsWindowFullscreen() )
{
ToggleFullscreen();
SetWindowSize( prevFullscreenWidth , prevFullscreenHeight );
SetWindowPosition( prevFullscreenX , prevFullscreenY );
}
else
{
prevFullscreenWidth = GetScreenWidth();
prevFullscreenHeight = GetScreenHeight();
prevFullscreenX = (int)GetWindowPosition().x;
prevFullscreenY = (int)GetWindowPosition().y;
int monitor = GetCurrentMonitor();
SetWindowSize( GetMonitorWidth(monitor) , GetMonitorHeight(monitor) );
ToggleFullscreen();
}
}
else // Borderless Fullscreen :
if ( IsKeyPressed( KEY_B ) )
{
ToggleBorderlessWindowed();
}
}
void draw()
{
int sw = GetScreenWidth();
int sh = GetScreenHeight();
int rw = GetRenderWidth();
int rh = GetRenderHeight();
Vector2 dpi = GetWindowScaleDPI();
int monitor = GetCurrentMonitor();
int mw = GetMonitorWidth( monitor );
int mh = GetMonitorHeight( monitor );
Rectangle infoRect = { 0.0 , 0.0 , sw , sh };
// Draw the border of the screen :
DrawRectangleLinesEx( infoRect , 4.0f , RED );
// Draw the text NOT in the center :
DrawText( TextFormat( "Screen : %d x %d" , sw , sh ) , 10 , 10 , 30 , BROWN );
DrawText( TextFormat( "Render : %d x %d" , rw , rh ) , 10 , 40 , 30 , DARKGREEN );
DrawText( TextFormat( "Monitor : %d x %d" , mw , mh ) , 10 , 70 , 30 , DARKBLUE );
DrawText( TextFormat( "DPI : %f x %f" , dpi.x , dpi.y ) , 10 , 100 , 30 , BLACK );
}
from raylib.
Edit : ok, i'm currently proceeeding to various test on a more simplified example, because there seems to be many other issues related to both ToggleFullscreen()
and FLAG_WINDOW_HIGHDPI
also on Linux. (using GLFW backend).
Maybe an separate issue should be opened for each different backends and OS ...
On my Linux desktop, here are my observations :
-
FLAG_WINDOW_RESIZABLE
andToggleFullScreen()
don't work well together. (better disableFLAG_WINDOW_RESIZABLE
before toggling) -
GetWindowScaleDPI()
returns1.145833 , 1.145833
despite my display is scale is set to 100% ... -
as mentioned by @fishbowlforever , there are multiple issues with
ToggleFullScreen()
whenFLAG_WINDOW_HIGHDPI
is enabled ...
#include "raylib.h"
void update();
void draw();
int main( int argc , char **argv )
{
//SetWindowState( FLAG_MSAA_4X_HINT );
SetConfigFlags(FLAG_WINDOW_HIGHDPI); // <======= ???
InitWindow( 1280 , 720 , "Test" );
//ClearWindowState( FLAG_VSYNC_HINT );
SetTargetFPS( 60 );
//SetWindowState( FLAG_WINDOW_RESIZABLE );
while( ! WindowShouldClose() )
{
update();
BeginDrawing();
{
ClearBackground( RAYWHITE );
draw();
}
EndDrawing();
}
CloseWindow();
}
void update()
{
if ( IsKeyPressed( KEY_F ) )
{
// SetWindowSize( 1280 , 720 );
ClearWindowState( FLAG_WINDOW_RESIZABLE );
ToggleFullscreen();
// SetWindowState( FLAG_WINDOW_RESIZABLE );
// SetWindowSize( 1280 , 720 );
}
else
if ( ! IsWindowFullscreen() && IsKeyPressed( KEY_B ) )
{
ToggleBorderlessWindowed();
}
}
void draw()
{
int sw = GetScreenWidth();
int sh = GetScreenHeight();
int rw = GetRenderWidth();
int rh = GetRenderHeight();
Vector2 dpi = GetWindowScaleDPI();
int monitor = GetCurrentMonitor();
int mw = GetMonitorWidth( monitor );
int mh = GetMonitorHeight( monitor );
Rectangle infoRect = { 0.0 , 0.0 , sw , sh };
// Draw the border of the screen :
DrawRectangleLinesEx( infoRect , 300.0f , RED );
// Draw the text NOT in the center :
DrawText( TextFormat( "Screen : %d x %d" , sw , sh ) , 10 , 10 , 30 , BROWN );
DrawText( TextFormat( "Render : %d x %d" , rw , rh ) , 10 , 40 , 30 , DARKGREEN );
DrawText( TextFormat( "Monitor : %d x %d" , mw , mh ) , 10 , 70 , 30 , DARKBLUE );
DrawText( TextFormat( "DPI : %f x %f" , dpi.x , dpi.y ) , 10 , 100 , 30 , BLACK );
DrawText( TextFormat( "infoRect : %f x %f" , infoRect.width , infoRect.height ) , 10 , 140 , 30 , RED ); // <===
}
from raylib.
Ok so if I replicated @fishbowlforever issue correctly, and if @fishbowlforever uses the GLFW backend, i think the culprit is here :
raylib/src/platforms/rcore_desktop_glfw.c
Lines 1670 to 1682 in 9764fef
I think that it is not required to divide by windowScaleDPI
because GLFW already handles that with glfwWindowHint(GLFW_SCALE_TO_MONITOR, GLFW_TRUE);
set here :
raylib/src/platforms/rcore_desktop_glfw.c
Lines 1300 to 1310 in 9764fef
@fishbowlforever , can you recompile Raylib to test this fix on your Windows OS ?
@SoloByte can you try too and tell me if it improve anything ? It should have no impact on Macos
In file raylib/src/platforms/rcore_desktop_glfw.c
, you just have to replace line 1671 with a if (0)
to disable the suspect branch.
// if ((CORE.Window.flags & FLAG_WINDOW_HIGHDPI) > 0)
if (0)
{
Vector2 windowScaleDPI = GetWindowScaleDPI();
CORE.Window.screen.width = (unsigned int)(width/windowScaleDPI.x);
CORE.Window.screen.height = (unsigned int)(height/windowScaleDPI.y);
}
else
{
CORE.Window.screen.width = width;
CORE.Window.screen.height = height;
}
Or apply this patch : #4143
from raylib.
@SuperUserNameMan thanks a lot for your suggestion and research
I compiled RL with your suggestion like this:
Fullscreen works like a charm now!
The only issue left is that, when disabling Fullscreen, the window only displays the top left quarter of the screen. This does not increment to 4x, 8x, 16x, etc. like it previously did though.
from raylib.
@fishbowlforever : Did you use the code example i provided ?
If not, could you please share a minimal code example of your own so i can see if there is something special that triggers this behavior ?
from raylib.
@SoloByte : It change nothing for Macos. There should be no diff.
@SuperUserNameMan can confirm that disabling resizable flag before entering fullscreen helps & can´t test it on macOS because I am not set up for raylib development.
Edit oh i've just noticed i misinterpreted your answer. Yes, disabling resizable flag before toggling to fullscreen should help, and might have an effect on Macos too.
from raylib.
@SoloByte @SuperUserNameMan Thank you very much for the extensive review of this issue, full-screen and high-dpi are big concerns on raylib that despite being reviewed many many times, still have issues, mostly platform and OS dependant...
@raysan5 should I open new issues for the other problems I have found mention above?
@SoloByte Yes, please, I think it would be easier to track the issues separately (despite being highly dependant). If you want I can also reopen this issue for reference.
from raylib.
Adding @JeffM2501 to the loop, I remember he had some ideas about ToggleFullscreen()
/ToggleFullscreenBorderless()
.
from raylib.
@SuperUserNameMan I have not tested it with the new patch
from raylib.
@SuperUserNameMan I have not tested it with the new patch
ok then, let's start again from a fresh code base then.
from raylib.
@SuperUserNameMan @fishbowlforever
The window resize callback also calls SetupViewport which introdues dpi scale again. I don‘t know if that causes any problems though.
What I have found is that fullscreen mode sets the window size to the current screen size before entering fullscreen instead of setting it to the monitor size. (Borderless fullscreen sets the window size to the monitor size)
Setting the window size calls the window resized callback and before fix #4143 it would then scale the current window size further down each time fullscreen is exited.
from raylib.
@SuperUserNameMan I have not tested it with the new patch
ok then, let's start again from a fresh code base then.
I agree but just for clarification, I have tested it on macOS with the same project as above. The patch you did should not have affected macOS anyway, correct?
from raylib.
i don't know how far you are with everything and so on but i tested your provided code on win11 to the same results in case thats still useful:
Fullscreen (F) works fantastically, but when disabling fullscreen for the first time, same issue happens as with my code.
from raylib.
If you use FLAG_WINDOW_HIGHDPI
at the same time as ToggleFullscreen()
, they are currently incompatible.
You have to choose one or another or replace ToggleFullscreen()
with ToggleBorderlessWindowed()
.
edit if you absolutely need to rescale your content accordingly to DPI, you better use the values of GetWindowScaleDPI()
to rescale your content manually by code.
from raylib.
Could you please test this PR #4151 ?
from raylib.
Related Issues (20)
- [rshapes] Specific Names for Color Arguments in DrawGradient Functions HOT 2
- [rcore] Tint Alpha not applied to texture when using BLEND_ALPHA_PREMULTIPLY HOT 16
- [rtext] incorrect handling of decimal point in TextToFloat
- [rtext] LoadFontEx does not set dont size correctly HOT 1
- [example] `models_point_rendering.c` example fails to build with Clang 18.1.3 on Ubuntu HOT 1
- [rcore] Gamepad detected, input not detected (linux) HOT 6
- [rcore] No suitable DRM connector found on Raspberry Pi with composite output HOT 2
- [raylib] Invalid parser behaviour on long function description HOT 1
- [build] Add an option to `build.zig` to support different `rcore` platforms HOT 2
- Debugger isn't working (mac, nvim) HOT 1
- [base] Add support for Meson Build System. HOT 6
- [raylib_parser] Segmentation fault HOT 1
- raylib Security Policy missing HOT 18
- [rcore] Incorrect line height when drawing text with line breaks HOT 1
- [rtexture] Drawing texture with negative width or height draws nothing HOT 1
- [rcore] Implement GetApplicationDirectory for FreeBSD
- [module] InitWindow( 0, 0, "Test"); crash on Samsung S24 dark mode (OK on Tablet S9+) HOT 14
- [rmodels] .mtl texture file does not automatically apply to .obj model file when displayed. HOT 5
- [rcore] Parser - invalid raylib_api.json HOT 11
- [rmodels] .obj file wont render in properly with the corresponding .mtl file. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib.