mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 07:22:44 +02:00
GLFB: fix X window at 16:9 aspect ratio
Origin commit data
------------------
Branch: master
Commit: 631c48e65b
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-05-04 (Sat, 04 May 2013)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -291,10 +291,11 @@ void GLFramebuffer::render()
|
|||||||
{
|
{
|
||||||
mReInit = false;
|
mReInit = false;
|
||||||
glViewport(0, 0, mX, mY);
|
glViewport(0, 0, mX, mY);
|
||||||
|
glutReshapeWindow(mX, mY);
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
float aspect = static_cast<float>(mX)/mY;
|
float aspect = static_cast<float>(mX)/mY;
|
||||||
float osdaspect = 1.0/aspect; //(static_cast<float>(mState.width)/mState.height);
|
float osdaspect = 1.0/(static_cast<float>(16.0)/9);
|
||||||
// if(!mState.go3d)
|
// if(!mState.go3d)
|
||||||
{
|
{
|
||||||
glOrtho(aspect*-osdaspect, aspect*osdaspect, -1.0, 1.0, -1.0, 1.0 );
|
glOrtho(aspect*-osdaspect, aspect*osdaspect, -1.0, 1.0, -1.0, 1.0 );
|
||||||
@@ -370,6 +371,11 @@ void GLFramebuffer::checkReinit()
|
|||||||
{
|
{
|
||||||
mX = x;
|
mX = x;
|
||||||
mY = y;
|
mY = y;
|
||||||
|
/* fix aspect ratio */
|
||||||
|
if (x < mY * 16 / 9)
|
||||||
|
mX = mY * 16 / 9;
|
||||||
|
else
|
||||||
|
mY = mX * 9 / 16;
|
||||||
mReInit = true;
|
mReInit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user