Return a const reference rather than a copy.
This commit is contained in:
@@ -24,7 +24,7 @@ public:
|
||||
virtual void SwapBuffers() = 0;
|
||||
virtual void Update() { }
|
||||
|
||||
virtual VideoModeParams GetActualVideoModeParams() const = 0;
|
||||
virtual const VideoModeParams &GetActualVideoModeParams() const = 0;
|
||||
|
||||
virtual bool SupportsThreadedRendering() { return false; }
|
||||
virtual void BeginConcurrentRendering() { }
|
||||
|
||||
@@ -26,7 +26,7 @@ public:
|
||||
void SwapBuffers();
|
||||
void Update();
|
||||
|
||||
VideoModeParams GetActualVideoModeParams() const { return m_CurrentParams; }
|
||||
const VideoModeParams &GetActualVideoModeParams() const { return m_CurrentParams; }
|
||||
private:
|
||||
void ShutDownFullScreen();
|
||||
int ChangeDisplayMode( const VideoModeParams& p );
|
||||
|
||||
@@ -16,7 +16,7 @@ public:
|
||||
void SwapBuffers();
|
||||
void Update();
|
||||
|
||||
VideoModeParams GetActualVideoModeParams() const { return CurrentParams; }
|
||||
const VideoModeParams &GetActualVideoModeParams() const { return CurrentParams; }
|
||||
|
||||
private:
|
||||
VideoModeParams CurrentParams;
|
||||
|
||||
@@ -281,9 +281,7 @@ void LowLevelWindow_Win32::Update()
|
||||
|
||||
VideoModeParams LowLevelWindow_Win32::GetActualVideoModeParams() const
|
||||
{
|
||||
VideoModeParams p;
|
||||
GraphicsWindow::GetParams( p );
|
||||
return p;
|
||||
return GraphcsWindow::GetParams();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
void BeginConcurrentRendering();
|
||||
void EndConcurrentRendering();
|
||||
|
||||
VideoModeParams GetActualVideoModeParams() const;
|
||||
const VideoModeParams &GetActualVideoModeParams() const;
|
||||
};
|
||||
|
||||
#ifdef ARCH_LOW_LEVEL_WINDOW
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
bool IsSoftwareRenderer( CString &sError );
|
||||
void SwapBuffers();
|
||||
|
||||
VideoModeParams GetActualVideoModeParams() const { return CurrentParams; }
|
||||
const VideoModeParams &GetActualVideoModeParams() const { return CurrentParams; }
|
||||
|
||||
void GetDisplayResolutions( DisplayResolutions &out ) const;
|
||||
|
||||
|
||||
@@ -468,9 +468,9 @@ HDC GraphicsWindow::GetHDC()
|
||||
return g_HDC;
|
||||
}
|
||||
|
||||
void GraphicsWindow::GetParams( VideoModeParams ¶msOut )
|
||||
const VideoModeParams &GraphicsWindow::GetParams()
|
||||
{
|
||||
paramsOut = g_CurrentParams;
|
||||
return g_CurrentParams;
|
||||
}
|
||||
|
||||
void GraphicsWindow::Update()
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace GraphicsWindow
|
||||
|
||||
void GetDisplayResolutions( DisplayResolutions &out );
|
||||
|
||||
void GetParams( VideoModeParams ¶msOut );
|
||||
const VideoModeParams &GetParams();
|
||||
HDC GetHDC();
|
||||
void Update();
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ void GraphicsWindow::SetVideoModeParams( const VideoModeParams ¶ms )
|
||||
g_CurrentParams = params;
|
||||
}
|
||||
|
||||
void GraphicsWindow::GetParams( VideoModeParams ¶msOut )
|
||||
const VideoModeParams &GraphicsWindow::GetParams()
|
||||
{
|
||||
paramsOut = g_CurrentParams;
|
||||
return g_CurrentParams;
|
||||
}
|
||||
|
||||
void GraphicsWindow::Update()
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace GraphicsWindow
|
||||
void RecreateGraphicsWindow( const VideoModeParams &p );
|
||||
void DestroyGraphicsWindow();
|
||||
void ConfigureGraphicsWindow( const VideoModeParams &p );
|
||||
void GetParams( VideoModeParams ¶msOut );
|
||||
const VideoModeParams &GetParams();
|
||||
void Update();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user