Reputation: 1
#ifndef RENDERER_H
#define RENDERER_H
#pragma once
#include "Font.h"
#include "Color.h"
#undef CreateFont
struct Vertex_t {
XMFLOAT4 xyzrhw;
D3DCOLOR color;
enum {
FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE
};
};
I get this error when i try to compile:
IntelliSense: identifier "XMFLOAT4" is undefined.
How do I fix this?
Upvotes: 0
Views: 2310
Reputation: 41067
It's not clear from your code where you including <DirectXMath.h>
, so I assume that's somewhere in Font.h or Color.h.
DirectXMath uses the C++ namespace DirectX
so you should use:
struct Vertex_t {
DirectX::XMFLOAT4 xyzrhw;
D3DCOLOR color;
enum {
FVF = D3DFVF_XYZRHW | D3DFVF_DIFFUSE
};
};
C++ coding recommendations is to avoid putting using namespace
statements in a header, only keeping them local to a .cpp file.
Upvotes: 8