raylib
raylib copied to clipboard
Implementing GetMonitorWidth/Height for DRM
Hello :)
I would like to propose an implementation for the following functions for the DRM platform :
- int GetMonitorWidth(int monitor)
- int GetMonitorHeight(int monitor)
- int GetMonitorPhysicalWidth(int monitor)
- int GetMonitorPhysicalHeight(int monitor)
- const char *GetMonitorName(int monitor)
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 :)
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: https://github.com/raysan5/raylib/issues/3946. Can you please tell me about it?
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 :)
By the way, there is both GetMonitorCount() and GetCurrentMonitor() which although log that they are not implemented, returns the correct value (because the actual implementation is limited to one screen only)
// 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!
Hello,
As @orcmid suggested I changed the getMonitorName to return "" as default and also I changed others functions to also evaluate negative monitors.
@gabriel-marques Thanks! Implementation looks good to me! Merging!