How to use ENQUEUE_RENDER_COMMAND instead of ENQUEUE_UNIQUE_RENDER_COMMAND_ONEPARAMETER

Hi,
I’m trying to fix a deprecation warning in AirSim plugin for UE4.22.



warning: Please use ENQUEUE_RENDER_COMMAND instead Please update your code to the new API before upgrading to the next release, otherwise your project will no longer compile. -W#pragma-messages]


https://github.com/Microsoft/AirSim/…st.cpp#L77-L83



ENQUEUE_UNIQUE_RENDER_COMMAND_ONEPARAMETER(
        SceneDrawCompletion,
        RenderRequest *, This, this,
        {
                This->ExecuteTask();
        }
);


How can I change the above call to use the new ENQUEUE_RENDER_COMMAND macro?

Try this:



RenderRequest* This = this;

ENQUEUE_RENDER_COMMAND(SceneDrawCompletion)(
[This](FRHICommandListImmediate& RHICmdList)
{
    This->ExecuteTask();
});


4 Likes