-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
[examples] Add core_monitor_change
#5215
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
[examples] Add core_monitor_change
#5215
Conversation
|
Based on the other PR, I will add more comments here as well. |
|
@maiconpintoabreu Considering raylib offers some void SetWindowMonitor(int monitor); // Set monitor for the current window
int GetMonitorCount(void); // Get number of connected monitors
int GetCurrentMonitor(void); // Get current monitor where window is placed
Vector2 GetMonitorPosition(int monitor); // Get specified monitor position
int GetMonitorWidth(int monitor); // Get specified monitor width (current video mode used by monitor)
int GetMonitorHeight(int monitor); // Get specified monitor height (current video mode used by monitor)
int GetMonitorPhysicalWidth(int monitor); // Get specified monitor physical width in millimetres
int GetMonitorPhysicalHeight(int monitor); // Get specified monitor physical height in millimetres
int GetMonitorRefreshRate(int monitor); // Get specified monitor refresh rate
Vector2 GetWindowPosition(void); // Get window position XY on monitor
const char *GetMonitorName(int monitor); // Get the human-readable, UTF-8 encoded name of the specified monitorFor example, have some keys to move window to the available monitors, show available monitors, show monitor names, physical size... |
core_monitor_change
28507ac to
50d0da2
Compare
|
@maiconpintoabreu As the monitor layouts can be now detected and also current window, I think it would be nice to visualize with a rectangle the current window and how it is moved between monitors in real time. |
|
The monitor that the window is will be highlighted and it happens as well if the window is moved manually. You can see it on the screenshot that the active one is in red. |
|
@maiconpintoabreu Example looks good, but why not show the information in the same way as the tool you are using, with the monitor name and resolution inside the rectangles. Seems more complete to me than just a number. |
e57e2d2 to
a247855
Compare
a247855 to
5a221e5
Compare
|
I got this issue: This closes the window when a monitor is removed while the example is trying to access the monitor information. |
|
@maiconpintoabreu Thanks for the new example and all the imrpovements implemented! About the GLFW issue... it should be reviewed. Please, could you open a separate issue for it? Thanks! |
* Add core monitor change example * Add monitor drawing and more information * Update monitor information every frame * Show info and window position inside the rectangle



Add an example to show how to get information about the monitor and move a window to another monitor.
Added for: #5209