Skip to content
This repository has been archived by the owner on Mar 3, 2020. It is now read-only.

alternative implementation of uetorch.SetResolution #40

Closed
mmmaat opened this issue Feb 9, 2017 · 2 comments
Closed

alternative implementation of uetorch.SetResolution #40

mmmaat opened this issue Feb 9, 2017 · 2 comments

Comments

@mmmaat
Copy link

mmmaat commented Feb 9, 2017

Hi Adam,

First of all, thanks for the UETorch plugin that works very well! I'm working on the NaivePhysics project after @marioyc, using the 4.8 version for now.

I found a problem with the current implementation of the SetResolution function. Taking a screenshot just after a resolution change give a black image (but depth and masks are OK). Below is an alternative implementation that fixes the problem...

// implemented from https://wiki.unrealengine.com/Game_User_Settings
extern "C" bool SetResolution(int x, int y) {
  if(! GEngine)
    return false;

  UGameUserSettings* Settings = GEngine->GameUserSettings;
  if(! Settings)
    return false;

  Settings->RequestResolutionChange(x, y, EWindowMode::Type::Windowed, false);
  Settings->ConfirmVideoMode();
  return true;
}
@adamlerer
Copy link
Contributor

Thanks @mmmaat , would you like to submit this as a PR?

@mmmaat
Copy link
Author

mmmaat commented Mar 20, 2017

Ok that's done ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants