-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Implementing GetMonitorWidth/Height for DRM #3956
Conversation
…t for drm Added implementation for DRM for functions : - GetMonitorWidth() - GetMonitorHeight() - GetMonitorPhysicalWidth() - GetMonitorPhysicalHeight() - GetMonnitorName() These functions take an argument but only the value 0 is accepted. This is because the DRM platform implementation manages only one screen for now
Hello. What would it be good for? In addition to the fact that I can find out these dimensions... At the moment we have encountered such an unpleasant dilemma regarding DRM: #3946. Can you please tell me about it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In GetMonitorName(int monitor)
for consistent behavior with the unimplemented case, you should use
const char name = "";
Also, you might want to do something about the non-zero value case, providing something like "unknown" or "unavailable". This will also avoid compiler warnings about monitor
not being used :).
It looks like it might be valuable to have a GetMonitorCount()
or similar as part of raylib.h
and have that always return 1
for DRM.
Isn't there a raylib.h
way to GetCurrentMonitor()
or something like that? (I am being lazy.)
I dont know yet. I just tuk here for few days. tests, tests, tests... |
Hello @orcmid :) Thanks for the suggested changes of consistency, I will apply them :) // Get number of monitors
int GetMonitorCount(void)
{
TRACELOG(LOG_WARNING, "GetMonitorCount() not implemented on target platform");
return 1;
}
// Get number of monitors
int GetCurrentMonitor(void)
{
TRACELOG(LOG_WARNING, "GetCurrentMonitor() not implemented on target platform");
return 0;
} |
@gabriel-marques Implementation looks good to me. Please, let me know when this PR is ready for merging! |
Refactored GetMonitorHeight, GetMonitorWidth, GetMonitorPhysicalHeight, GetMonitorPhysicalWidth and GetMonitorName to accept only argument "0" as more than one screen is not supported in DRM platform.
Hello, As @orcmid suggested I changed the |
@gabriel-marques Thanks! Implementation looks good to me! Merging! |
Hello :)
I would like to propose an implementation for the following functions for the DRM platform :
Although the monitor selection is not supported for the drm platform I kept the argument to avoid having multiple function prototypes.
I hope it complies to your coding rules :)