Get viewport native resource crash in standalone

hi,I want to share unreal screen using Spout-UE4 plugin(https://github.com/AleDel/Spout-UE4), it can send viewport image fast, but can only run in the editor play, in standalone or package will crash.

I found it might be in this code crash

	ID3D11Texture2D* baseTexture = 0;
	baseTexture = (ID3D11Texture2D*)GEngine->GameViewport->Viewport->GetRenderTargetTexture()->GetNativeResource();

How can I work after package?

thanks

Hello s25796,

From looking at the description for this plugin, it mentions that it requires OpenGL. Are you including OpenGL as one of your targeted RHIs when packaging? This can be enabled in Project Settings > Platforms > Windows.

thank you Matthew Clark, I will try opengl related issues,

And sorry,I found that I posted the wrong URL before,
I use this https://github.com/AleDel/Spout-UE4, not https://github.com/Allar/UE4ToSpout.
I know the author has said that can not run in standalone, but I was wondering if there was any way to improve,please help me again, thank you

If the author mentions that it can’t be run in standalone, that must be the case. If you need to figure out how to do this, it would be best to contact the developer as we don’t provide direct support for third party plugins.

OK i ask the author, but I want to know why this unreal engine code can not work in standalone games.

/** Global engine pointer. Can be 0 so don't use without checking. */
extern ENGINE_API class UEngine*			GEngine;

GEngine->GameViewport->Viewport->GetRenderTargetTexture()->GetNativeResource();

Only work in editor play, I opened the new project, only to call this code, is the same result.
Thank you

As mentioned by that line, it’s part of the ENGINE_API, meaning it is only available in the engine. If the Engine_API was included in the game code, it would make it much larger and cause multiple performance issues.