mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Add IGraphics::GetScreenName
To get the screen name for each screen index.
This commit is contained in:
parent
6bffc858fd
commit
abfafa314a
|
@ -882,6 +882,12 @@ bool CGraphicsBackend_SDL_GL::GetDriverVersion(EGraphicsDriverAgeType DriverAgeT
|
|||
return false;
|
||||
}
|
||||
|
||||
const char *CGraphicsBackend_SDL_GL::GetScreenName(int Screen) const
|
||||
{
|
||||
const char *pName = SDL_GetDisplayName(Screen);
|
||||
return pName == nullptr ? "unknown/error" : pName;
|
||||
}
|
||||
|
||||
static void DisplayToVideoMode(CVideoMode *pVMode, SDL_DisplayMode *pMode, int HiDPIScale, int RefreshRate)
|
||||
{
|
||||
pVMode->m_CanvasWidth = pMode->w * HiDPIScale;
|
||||
|
|
|
@ -253,6 +253,7 @@ public:
|
|||
const TTWGraphicsGPUList &GetGPUs() const override;
|
||||
|
||||
int GetNumScreens() const override { return m_NumScreens; }
|
||||
const char *GetScreenName(int Screen) const override;
|
||||
|
||||
void GetVideoModes(CVideoMode *pModes, int MaxModes, int *pNumModes, int HiDPIScale, int MaxWindowWidth, int MaxWindowHeight, int ScreenID) override;
|
||||
void GetCurrentVideoMode(CVideoMode &CurMode, int HiDPIScale, int MaxWindowWidth, int MaxWindowHeight, int ScreenID) override;
|
||||
|
|
|
@ -2939,6 +2939,11 @@ int CGraphics_Threaded::GetNumScreens() const
|
|||
return m_pBackend->GetNumScreens();
|
||||
}
|
||||
|
||||
const char *CGraphics_Threaded::GetScreenName(int Screen) const
|
||||
{
|
||||
return m_pBackend->GetScreenName(Screen);
|
||||
}
|
||||
|
||||
void CGraphics_Threaded::Minimize()
|
||||
{
|
||||
m_pBackend->Minimize();
|
||||
|
|
|
@ -731,6 +731,7 @@ public:
|
|||
virtual void GetCurrentVideoMode(CVideoMode &CurMode, int HiDPIScale, int MaxWindowWidth, int MaxWindowHeight, int Screen) = 0;
|
||||
|
||||
virtual int GetNumScreens() const = 0;
|
||||
virtual const char *GetScreenName(int Screen) const = 0;
|
||||
|
||||
virtual void Minimize() = 0;
|
||||
virtual void Maximize() = 0;
|
||||
|
@ -1257,6 +1258,8 @@ public:
|
|||
void IndicesNumRequiredNotify(unsigned int RequiredIndicesCount) override;
|
||||
|
||||
int GetNumScreens() const override;
|
||||
const char *GetScreenName(int Screen) const override;
|
||||
|
||||
void Minimize() override;
|
||||
void Maximize() override;
|
||||
void WarnPngliteIncompatibleImages(bool Warn) override;
|
||||
|
|
|
@ -506,6 +506,7 @@ public:
|
|||
|
||||
virtual void Swap() = 0;
|
||||
virtual int GetNumScreens() const = 0;
|
||||
virtual const char *GetScreenName(int Screen) const = 0;
|
||||
|
||||
// synchronization
|
||||
virtual void InsertSignal(class CSemaphore *pSemaphore) = 0;
|
||||
|
|
Loading…
Reference in a new issue