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