Replies: 5 comments 2 replies
-
Not a guide... but perhaps it helps a little. As far as I can say, with my own research on the net and testing on a 4K Monitor owned by an co worker.... I used:
I use a virtual game screen. there is an raylib - example for this at: "raylib [core] example - window scale letterbox (and virtual mouse)" for my simple patience card game and the window setting is
I can't remember exactly why but afaik the graphics should named with fx. "[email protected]" and should twice bigger hope that helps a little. Best, |
Beta Was this translation helpful? Give feedback.
-
Hello Michael, Thank you for reply!! of course i tried to use FLAG_WINDOW_HIGHDPI flag ... also with/without it result the same. here is my simple example: #include "raylib.h"
int main(int argc, const char * argv[]) {
const int screenWidth = 400;
const int screenHeight = 400;
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_VSYNC_HINT | FLAG_WINDOW_HIGHDPI);
InitWindow(screenWidth, screenHeight, "dpi-test");
SetTargetFPS(60);
Image image = LoadImage("/path/to/PrintDPI.png");
Texture2D texture = LoadTextureFromImage(image);
UnloadImage(image);
while (!WindowShouldClose()) {
if (IsKeyPressed(KEY_ESCAPE)) break;
BeginDrawing();
ClearBackground(GRAY);
DrawText("THIS IS TEST 1234 [] -_/\\!", 100, 50, 12, BLACK);
DrawTexture(texture, 100, 100, WHITE);
EndDrawing();
}
CloseWindow();
return 0;
}
and here is result By the way - using windows 11 it works (I can see smaller window and high resolution picture) Also i tried to put binary inside of "Some.app" with Contents/Info.plist and |
Beta Was this translation helpful? Give feedback.
-
As far as I know... Windows is different from MacOS.... From Web search (I am a no native English speaker): HiDPI mode means that the display stays at a certain resolution but draws everything scaled twice. E.g. a 3840x2160 (4K) display can work as a huuuuge display with the screen real estate of four (normal) FullHD displays. A "scaled resolution" is a term Apple uses for something that's really just feeding a non-native resolution to the display. For example, I'm running my 13" at 1440x900, scaled. The display itself is 2560x1600.
Windows handles scaling differently - window and font sizes are actually changing by a percentage. This produces clear and sharp images but is much harder to implement and can cause weird compatibility problems. That describes what I mean... on Mac your image size must be greater not the dpi itself. I add some screens from my game. hope that clarifies what I meant . The Image of a card, used in the game is only 113x157 pixel. This way the hole game screen can scale... see the next 2 screen shots and that way it is also looks good on a 4K Display connected to a Mac. I have no idea if this works on windows ... I stopped using Windows at Windows98 and never looked back :) best, |
Beta Was this translation helpful? Give feedback.
-
Hello Michael, For sure I know about highDPI on win/macOS and anyway Thank you for explanation! Without this parameter image will not fit pixel->pixel on the screen (which is HighDPI). Question is: Under the hood of raylib, GLFW in use and maybe something wrong with it? Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hello Jev… i am sorry but i am not an expert on this topic… Best, |
Beta Was this translation helpful? Give feedback.
-
Hello guys,
Is any verified guide how to enable HighDPI for Mac available?
i tired SetConfigFlags(FLAG_WINDOW_HIGHDPI) and "NSHighResolutionCapable" with Info.plist - is not working.
My macOs is Ventura and raylib 4.5.0
Thanks,
Jev.
Beta Was this translation helpful? Give feedback.
All reactions