parent
8dbd3f8bd5
commit
9f47607c95
1 changed files with 17 additions and 0 deletions
|
@ -403,6 +403,18 @@ static void upper_case_property(const char *name)
|
||||||
p->addChangeListener(muc);
|
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
|
// Propose NVIDIA Optimus / AMD Xpress to use high-end GPU
|
||||||
#if defined(SG_WINDOWS)
|
#if defined(SG_WINDOWS)
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
@ -541,6 +553,11 @@ int fgMainInit( int argc, char **argv )
|
||||||
fntInit();
|
fntInit();
|
||||||
globals->get_renderer()->preinit();
|
globals->get_renderer()->preinit();
|
||||||
|
|
||||||
|
if (fgGetBool("/sim/ati-viewport-hack", true)) {
|
||||||
|
SG_LOG(SG_GENERAL, SG_WARN, "Enabling ATI/AMD viewport hack");
|
||||||
|
ATIScreenSizeHack();
|
||||||
|
}
|
||||||
|
|
||||||
fgOutputSettings();
|
fgOutputSettings();
|
||||||
|
|
||||||
//try to disable the screensaver
|
//try to disable the screensaver
|
||||||
|
|
Loading…
Reference in a new issue