Reputation: 134
The Tutorial works when Linked to Single-Threaded Run-Time Library:
http://www.rastertek.com/dx11s2tut04.html
Visual Studio 2017 -- Single-Threaded Run-Time Library is not an option.
Property Manager -> Common Properties -> C/C++ -> Code Generation -> Runtime
Multi-Threaded (/MT)
Multi-Threaded Debug (/MTd)
Multi-Threaded DLL (/MD)
Multi-Threaded DLL Debug (/MDd)
Solution 1) How to link with Single-Threaded Run-Time Library with Visual Studio 2017 or 2019.
Solution 2) A Hello Triangle tutorial that has Deferred Context, not Immediate Context.
Upvotes: 0
Views: 128
Reputation: 134
class CameraClass
{
public:
CameraClass();
CameraClass(const CameraClass&);
~CameraClass();
void SetPosition(float, float, float);
void SetRotation(float, float, float);
XMFLOAT3 GetPosition();
XMFLOAT3 GetRotation();
void Render();
void GetViewMatrix(XMMATRIX&);
private:
// I Used
XMVECTOR position;
XMVECTOR rotation;
// instead of
// float m_positionX, m_positionY, m_positionZ;
// float m_rotationX, m_rotationY, m_rotationZ;
XMMATRIX m_viewMatrix;
};
Thus, Non-Virtual Methods have a function pointer cost per instance; or at least on the first instance.
Upvotes: 0