1
0
Fork 0

Revert "Remove the Ati viewport hack."

This reverts commit 5bf9b3cd02.
This commit is contained in:
James Turner 2017-04-12 11:13:14 +01:00
parent 8dbd3f8bd5
commit 9f47607c95

View file

@ -403,6 +403,18 @@ static void upper_case_property(const char *name)
p->addChangeListener(muc);
}
// this hack is needed to avoid weird viewport sizing within OSG on Windows.
// still required as of March 2017, sad times.
// see for example https://sourceforge.net/p/flightgear/codetickets/1958/
static void ATIScreenSizeHack()
{
osg::ref_ptr<osg::Camera> hackCam = new osg::Camera;
hackCam->setRenderOrder(osg::Camera::PRE_RENDER);
int prettyMuchAnyInt = 1;
hackCam->setViewport(0, 0, prettyMuchAnyInt, prettyMuchAnyInt);
globals->get_renderer()->addCamera(hackCam, false);
}
// Propose NVIDIA Optimus / AMD Xpress to use high-end GPU
#if defined(SG_WINDOWS)
extern "C" {
@ -541,6 +553,11 @@ int fgMainInit( int argc, char **argv )
fntInit();
globals->get_renderer()->preinit();
if (fgGetBool("/sim/ati-viewport-hack", true)) {
SG_LOG(SG_GENERAL, SG_WARN, "Enabling ATI/AMD viewport hack");
ATIScreenSizeHack();
}
fgOutputSettings();
//try to disable the screensaver