raylib
raylib copied to clipboard
[rcore] Render issue when window is partially move outside of the monitor
Please, before submitting a new issue verify and check:
- [x] I tested it on latest raylib version from master branch
- [x] I checked there is no similar issue already reported
- [x] I checked the documentation on the wiki
- [x] My code has no errors or misuse of raylib
Issue description
On MacOS when you drag the window slightly out of the monitor on the left, the rendering shrinks in half in the window, but only if there is a call to BeginTextureMode() in the render loop. If I remove the BeginTextureMode() from my render code, this issue does not happen. (See video below)
Environment
MacOS 14.3.1 (M1 - Apple Chip), OpenGL version 3
Issue Screenshot
https://github.com/raysan5/raylib/assets/69216913/aac54f10-539a-47b1-a3dc-d5f338150e74
Code Example
#include "raylib.h"
int main(void)
{
const int windowWidth = 800;
const int windowHeight = 450;
InitWindow(windowWidth, windowHeight, "test");
RenderTexture2D target = LoadRenderTexture(windowWidth, windowHeight);
while (!WindowShouldClose())
{
BeginTextureMode(target);
EndTextureMode();
BeginDrawing();
ClearBackground(BLACK);
DrawRectangle(0, 0, windowWidth, windowHeight, RED);
EndDrawing();
}
UnloadRenderTexture(target);
CloseWindow();
return 0;
}
Wow! Good catch! Why???
I have a feeling that it's related to a DPI issue. The only thing that I notice is that when the window is centered in the screen GetWindowScaleDPI() returns 2.0 and when I drag it out of the screen it returns 1.0. That could explain why the render is half the size, but it doesn't explain why it works fine when you don't use BeginTextureMode() O.o
@hubastard do you have multiple monitors or just the one? trying to replicate this
I was on a M1 MacBook without any external monitors.
Has this been resolved?
Has this been resolved?
I think so, I tried the code and didn't have any issue
I tested this on my Macbook Air M2, MacOS 15.0.1.
Raylib is main branch, v5.5 base on raylib.h.
VSCode project is from raylib-quickstart.
https://github.com/user-attachments/assets/b15af7f0-995d-4a76-88ea-00ffa8270b48
I also tested with my external monitor connected and moved between monitors. Not seeing the issue.
@hubastard What raylib version and build option you using?
@raysan5, this should probably be closed because the last comment was 2 weeks ago and the issue was fixed.
@Mute124 yeah, agree.
Sorry for the delay, but I just wanted to add that I tested again with the latest 5.5 release and the bug is fixed. Thanks
@hubastard that's great! thanks for the feedback! 🙂