-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with Monitor functions #273
Comments
Hey @dsoronda , |
ok. I assumed that I first need to know monitor count before displaying Window. Still there are issues. I have two monitors,
using Raylib_cs;
Raylib.InitWindow( 800, 600, "Hello World" ); // displays window on left (non primary monitor)
var monitorCount = Raylib.GetMonitorCount();
Console.WriteLine( $"Found {monitorCount} monitors" );
for (var counter = 0; counter < monitorCount; counter++) {
var monitorWidth = Raylib.GetMonitorWidth( counter );
var monitorHeight = Raylib.GetMonitorHeight( counter );
var refreshRate = Raylib.GetMonitorRefreshRate( counter);
Console.WriteLine( $"[{counter}] {monitorWidth} x {monitorHeight} {refreshRate} Hz" );
// var primaryMonitorName = Raylib.GetMonitorName( counter ); // requires UNSAFE
}
var position = Raylib.GetWindowPosition();
Console.WriteLine( $"position {position.X} x {position.Y} " ); // position 0 x 0 (should be mid of first window , not 0x0)
Thread.Sleep( 5000 );
Raylib.CloseWindow(); which outputs: INFO: Initializing raylib 5.0
INFO: Platform backend: DESKTOP (GLFW)
INFO: Supported raylib modules:
INFO: > rcore:..... loaded (mandatory)
INFO: > rlgl:...... loaded (mandatory)
INFO: > rshapes:... loaded (optional)
INFO: > rtextures:. loaded (optional)
INFO: > rtext:..... loaded (optional)
INFO: > rmodels:... loaded (optional)
INFO: > raudio:.... loaded (optional)
INFO: DISPLAY: Device initialized successfully
INFO: > Display size: 3440 x 1440 // this is my primary monitor
INFO: > Screen size: 800 x 600
INFO: > Render size: 800 x 600
INFO: > Viewport offsets: 0, 0
INFO: GLAD: OpenGL extensions loaded successfully
INFO: GL: Supported extensions count: 401
INFO: GL: OpenGL device information:
INFO: > Vendor: NVIDIA Corporation
INFO: > Renderer: NVIDIA GeForce RTX 3080 Ti/PCIe/SSE2
INFO: > Version: 3.3.0 NVIDIA 560.35.03
INFO: > GLSL: 3.30 NVIDIA via Cg compiler
INFO: GL: VAO extension detected, VAO functions loaded successfully
INFO: GL: NPOT textures extension detected, full NPOT textures supported
INFO: GL: DXT compressed textures supported
INFO: GL: ETC2/EAC compressed textures supported
INFO: PLATFORM: DESKTOP (GLFW): Initialized successfully
INFO: TEXTURE: [ID 1] Texture loaded successfully (1x1 | R8G8B8A8 | 1 mipmaps)
INFO: TEXTURE: [ID 1] Default texture loaded successfully
INFO: SHADER: [ID 1] Vertex shader compiled successfully
INFO: SHADER: [ID 2] Fragment shader compiled successfully
INFO: SHADER: [ID 3] Program shader loaded successfully
INFO: SHADER: [ID 3] Default shader loaded successfully
INFO: RLGL: Render batch vertex buffers loaded successfully in RAM (CPU)
INFO: RLGL: Render batch vertex buffers loaded successfully in VRAM (GPU)
INFO: RLGL: Default OpenGL state initialized successfully
INFO: TEXTURE: [ID 2] Texture loaded successfully (128x128 | GRAY_ALPHA | 1 mipmaps)
INFO: FONT: Default font loaded successfully (224 glyphs)
Found 2 monitors
[0] 3440 x 1440 120 Hz
[1] 1200 x 1920 60 Hz
position 0 x 0
INFO: TEXTURE: [ID 2] Unloaded texture data from VRAM (GPU)
INFO: SHADER: [ID 3] Default shader unloaded successfully
INFO: TEXTURE: [ID 1] Default texture unloaded successfully
INFO: Window closed successfully Found 2 monitors |
I can't find any issues in Raylib-cs or raylib itself: Seems like a GLFW problem: Hey says:
|
Before submitting a new issue, please verify and check:
Issue description
Note, X11 sees right one at offset of 1080p.
Environment
Ubuntu 24.04, X11 KDE desktop, Dotnet 8, Raylib-cs v6.1.1, Nvidia 3080 Ti Driver Version: 550.107.02 CUDA Version: 12.4
Code example
outputs
The text was updated successfully, but these errors were encountered: