first time here. Im trying to move the .png file using direct3d 9 function: &D3DXVECTOR3 but when I run local windows debugger it shows '&' require l-value error. I tried to search for similar case using direct3d9 but I found nothing. I would like to know what is the cause of the error and how could I fix it.
sprite->Draw(pointer, NULL, NULL, &D3DXVECTOR3(32, 32, 0), D3DCOLOR_XRGB(255, 255, 255));
I use NULL instead of D3DXVECTOR3 at first and it runs perfectly but when change to D3DXVECTOR3 it shows the error.
Taking the address of a temporary object like this is not C++ standard conformant.
Microsoft Visual C++ has historically accepted this usage as a "language extension", and it still does unless you are building with
/permissive-(i.e. Conformance Mode) enabled. Without/permissive-, at Warning Level 4 it still emits a C4238 warning.clang/LLVM for Windows will also accept this usage, but outputs a
-Waddress-of-temporarywarning.The conformant solution is to create a named temporary: