Merge pull request #3 from Pwootage/cmake
Fix HiDPI on macOS (and possibly others?)
This commit is contained in:
commit
92723598fe
|
@ -49,7 +49,8 @@ void CBasicViewport::initializeGL()
|
||||||
void CBasicViewport::paintGL()
|
void CBasicViewport::paintGL()
|
||||||
{
|
{
|
||||||
// Prep render
|
// Prep render
|
||||||
glViewport(0, 0, width(), height());
|
float scale = devicePixelRatioF();
|
||||||
|
glViewport(0, 0, (int)((float)width() * scale), (int)((float)height() * scale));
|
||||||
glLineWidth(1.f);
|
glLineWidth(1.f);
|
||||||
glEnable(GL_DEPTH_TEST);
|
glEnable(GL_DEPTH_TEST);
|
||||||
mViewInfo.ViewFrustum = mCamera.FrustumPlanes();
|
mViewInfo.ViewFrustum = mCamera.FrustumPlanes();
|
||||||
|
@ -67,7 +68,8 @@ void CBasicViewport::paintGL()
|
||||||
void CBasicViewport::resizeGL(int Width, int Height)
|
void CBasicViewport::resizeGL(int Width, int Height)
|
||||||
{
|
{
|
||||||
mCamera.SetAspectRatio((float) Width / Height);
|
mCamera.SetAspectRatio((float) Width / Height);
|
||||||
glViewport(0, 0, Width, Height);
|
float scale = devicePixelRatioF();
|
||||||
|
glViewport(0, 0, (int)((float)Width * scale), (int)((float)Height * scale));
|
||||||
OnResize();
|
OnResize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue