I'm having some trouble setting two variables of type XMMATRIX** in a function. The function prototype looks like this:
bool ViewportFactory::CreateViewport(CanvasHandle* canvasHandlePtr, ViewportHandle** outViewportHandlePtr, DirectX::XMMATRIX** outProjectionMatrix, DirectX::XMMATRIX** outViewMatrix)
Then, later on in the function definition, I have the following two lines:
*outProjectionMatrix = new DirectX::XMMATRIX(0.0f, 0.1f, /* ... */, 3.3f);
*outViewMatrix = new DirectX::XMMATRIX(0.0f, 0.1f, /* ... */, 3.3f);
However, in a Win32 build with optimisations turned on, those lines give me an access violation.
It's hard to reason about exactly where the problem is with optimisations turned on, but if I change those lines to set the values to nullptr
, then the problem goes away.